public final class FBBlobOutputStream extends OutputStream implements FirebirdBlob.BlobOutputStream
OutputStream
for writing Firebird blobs.Modifier and Type | Method and Description |
---|---|
void |
close()
Close this stream.
|
void |
flush() |
FirebirdBlob |
getBlob()
Get instance of
FirebirdBlob to which this stream belongs to. |
long |
length()
Get Blob length.
|
void |
write(byte[] b,
int off,
int len)
Write data from the buffer into this stream.
|
void |
write(int b)
Write single byte into the stream.
|
write
public FirebirdBlob getBlob()
FirebirdBlob.BlobOutputStream
FirebirdBlob
to which this stream belongs to.
Note, code
FirebirdBlob.BlobOutputStream otherStream = (FirebirdBlob.BlobOutputStream) inputStream.getBlob().setBinaryStream(1);will return new stream object.
getBlob
in interface FirebirdBlob.BlobOutputStream
FirebirdBlob
.public long length() throws IOException
FirebirdBlob.BlobOutputStream
length
in interface FirebirdBlob.BlobOutputStream
IOException
- if I/O error occurs.public void write(int b) throws IOException
Writes are buffered up to the buffer length of the blob (optionally specified by the connection
property blobBufferSize
).
write
in interface FirebirdBlob.BlobOutputStream
write
in class OutputStream
b
- data to write, only lowest 8 bits are written.IOException
- if I/O error occurs.public void write(byte[] b, int off, int len) throws IOException
Writes are buffered up to the buffer length of the blob (optionally specified by the connection
property blobBufferSize
).
write
in interface FirebirdBlob.BlobOutputStream
write
in class OutputStream
b
- buffer from which data should be written.off
- offset in the buffer.len
- number of bytes to write.IOException
- if I/O error occurs.public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
FirebirdBlob.BlobOutputStream
close
in interface Closeable
close
in interface AutoCloseable
close
in interface FirebirdBlob.BlobOutputStream
close
in class OutputStream
IOException
- if I/O error occurs.Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.