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 intNumber of bytes stored in the bufferFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()protected voidvoidwrite(byte[] b, int off, int len) voidwrite(int b) voidwrite(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.Methods inherited from class java.io.FilterOutputStream
close, writeMethods 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:
flushin interfaceFlushable- Overrides:
flushin classFilterOutputStream- Throws:
IOException
-
writeInt2
- Throws:
IOException
-
writeInt4
- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein 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
-