Package org.postgresql.largeobject
Class BlobOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.postgresql.largeobject.BlobOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class BlobOutputStream extends OutputStream
This implements a basic output stream that writes to a LargeObject.
-
-
Constructor Summary
Constructors Constructor Description BlobOutputStream(LargeObject lo)Create an OutputStream to a large object.BlobOutputStream(LargeObject lo, int bsize)Create an OutputStream to a large object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()Flushes this output stream and forces any buffered output bytes to be written out.voidwrite(byte[] buf, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Constructor Detail
-
BlobOutputStream
public BlobOutputStream(LargeObject lo)
Create an OutputStream to a large object.- Parameters:
lo- LargeObject
-
BlobOutputStream
public BlobOutputStream(LargeObject lo, int bsize)
Create an OutputStream to a large object.- Parameters:
lo- LargeObjectbsize- The size of the buffer used to improve performance
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOExceptionFlushes this output stream and forces any buffered output bytes to be written out. The general contract offlushis that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- if an I/O error occurs.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
-