Package org.firebirdsql.jdbc
Class FBBlobOutputStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- org.firebirdsql.jdbc.FBBlobOutputStream
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable,- FirebirdBlob.BlobOutputStream
 
 public final class FBBlobOutputStream extends java.io.OutputStream implements FirebirdBlob.BlobOutputStream OutputStreamfor writing Firebird blobs.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this stream.voidflush()FirebirdBlobgetBlob()Get instance ofFirebirdBlobto which this stream belongs to.longlength()Get Blob length.voidwrite(byte[] b, int off, int len)Write data from the buffer into this stream.voidwrite(int b)Write single byte into the stream.
 
- 
- 
- 
Method Detail- 
getBlobpublic FirebirdBlob getBlob() Description copied from interface:FirebirdBlob.BlobOutputStreamGet instance ofFirebirdBlobto which this stream belongs to.Note, code FirebirdBlob.BlobOutputStream otherStream = (FirebirdBlob.BlobOutputStream) inputStream.getBlob().setBinaryStream(1);will return new stream object.- Specified by:
- getBlobin interface- FirebirdBlob.BlobOutputStream
- Returns:
- instance of FirebirdBlob.
 
 - 
lengthpublic long length() throws java.io.IOExceptionDescription copied from interface:FirebirdBlob.BlobOutputStreamGet Blob length. This method is the only available way to obtain length of a Blob that is in temporary state,- Specified by:
- lengthin interface- FirebirdBlob.BlobOutputStream
- Returns:
- length of the blob.
- Throws:
- java.io.IOException- if I/O error occurs.
 
 - 
writepublic void write(int b) throws java.io.IOExceptionWrite single byte into the stream.Writes are buffered up to the buffer length of the blob (optionally specified by the connection property blobBufferSize).- Specified by:
- writein interface- FirebirdBlob.BlobOutputStream
- Specified by:
- writein class- java.io.OutputStream
- Parameters:
- b- data to write, only lowest 8 bits are written.
- Throws:
- java.io.IOException- if I/O error occurs.
 
 - 
writepublic void write(byte[] b, int off, int len) throws java.io.IOExceptionWrite data from the buffer into this stream.Writes are buffered up to the buffer length of the blob (optionally specified by the connection property blobBufferSize).- Specified by:
- writein interface- FirebirdBlob.BlobOutputStream
- Overrides:
- writein class- java.io.OutputStream
- Parameters:
- b- buffer from which data should be written.
- off- offset in the buffer.
- len- number of bytes to write.
- Throws:
- java.io.IOException- if I/O error occurs.
 
 - 
flushpublic void flush() throws java.io.IOException- Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- java.io.OutputStream
- Throws:
- java.io.IOException
 
 - 
closepublic void close() throws java.io.IOExceptionDescription copied from interface:FirebirdBlob.BlobOutputStreamClose this stream. Calling this method closes Blob stream and moves Blob from temporary into permanent state making any further content updates impossible.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Specified by:
- closein interface- FirebirdBlob.BlobOutputStream
- Overrides:
- closein class- java.io.OutputStream
- Throws:
- java.io.IOException- if I/O error occurs.
 
 
- 
 
-