Package org.postgresql.core
Class FixedLengthOutputStream
java.lang.Object
java.io.OutputStream
org.postgresql.core.FixedLengthOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A stream that refuses to write more than a maximum number of bytes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
private void
verifyAllowed
(int wanted) void
write
(byte[] buf, int offset, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
Field Details
-
size
private final int size -
target
-
written
private int written
-
-
Constructor Details
-
FixedLengthOutputStream
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
remaining
public int remaining() -
verifyAllowed
- Throws:
IOException
-