Package org.postgresql.util.internal
Class PgBufferedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.postgresql.util.internal.PgBufferedOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Direct Known Subclasses:
GSSOutputStream
Buffered output stream. The key difference from
BufferedOutputStream
is that
PgBufferedOutputStream
does not perform synchronization.
This is an internal class, and it is not meant to be used as a public API.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]
Buffer for the dataprotected int
Number of bytes stored in the bufferFields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
protected void
void
write
(byte[] b, int off, int len) void
write
(int b) void
write
(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.Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
buf
protected final byte[] bufBuffer for the data -
count
protected int countNumber of bytes stored in the buffer
-
-
Constructor Details
-
PgBufferedOutputStream
-
-
Method Details
-
flushBuffer
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
writeInt2
- Throws:
IOException
-
writeInt4
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
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:
IOException
- in case writing to the output stream failsSourceStreamIOException
- in case reading from the source stream fails
-
writeZeros
Writes the required number of zero bytes to the output stream.- Parameters:
len
- number of bytes to write- Throws:
IOException
- in case writing to the underlying stream fails
-