Package org.postgresql.util.internal
Class PgBufferedOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.postgresql.util.internal.PgBufferedOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
- Direct Known Subclasses:
GSSOutputStream
public class PgBufferedOutputStream extends java.io.FilterOutputStreamBuffered output stream. The key difference fromBufferedOutputStreamis thatPgBufferedOutputStreamdoes not perform synchronization. This is an internal class, and it is not meant to be used as a public API.
-
-
Constructor Summary
Constructors Constructor Description PgBufferedOutputStream(java.io.OutputStream out, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()protected voidflushBuffer()voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwrite(java.io.InputStream inStream, int remaining)Writes the given amount of bytes from an input stream to this buffered stream.voidwriteInt2(int val)voidwriteInt4(int val)voidwriteZeros(int len)Writes the required number of zero bytes to the output stream.
-
-
-
Method Detail
-
flushBuffer
protected void flushBuffer() throws java.io.IOException- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
writeInt2
public void writeInt2(int val) throws java.io.IOException- Throws:
java.io.IOException
-
writeInt4
public void writeInt4(int val) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
write
public void write(java.io.InputStream inStream, int remaining) throws java.io.IOExceptionWrites the given amount of bytes from an input stream to this buffered stream.- Parameters:
inStream- input dataremaining- the number of bytes to transfer- Throws:
java.io.IOException- in case writing to the output stream failsSourceStreamIOException- in case reading from the source stream fails
-
writeZeros
public void writeZeros(int len) throws java.io.IOExceptionWrites the required number of zero bytes to the output stream.- Parameters:
len- number of bytes to write- Throws:
java.io.IOException- in case writing to the underlying stream fails
-
-