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.FilterOutputStream
Buffered output stream. The key difference fromBufferedOutputStream
is thatPgBufferedOutputStream
does 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 void
flush()
protected void
flushBuffer()
void
write(byte[] b, int off, int len)
void
write(int b)
void
write(java.io.InputStream inStream, int remaining)
Writes the given amount of bytes from an input stream to this buffered stream.void
writeInt2(int val)
void
writeInt4(int val)
void
writeZeros(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:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in 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:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
write
public void write(java.io.InputStream inStream, int remaining) throws java.io.IOException
Writes 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.IOException
Writes 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
-
-