org.intermine.util
Class SensibleByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.intermine.util.SensibleByteArrayOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
- Direct Known Subclasses:
- PostgresByteArrayOutputStream
public class SensibleByteArrayOutputStream
- extends java.io.ByteArrayOutputStream
A subclass of ByteArrayOutputStream that behaves a little more sensibly when handling large
writes followed by small writes.
| Fields inherited from class java.io.ByteArrayOutputStream |
buf, count |
|
Method Summary |
void |
assureSize(int newSize)
Resizes the buffer to ensure it is as large as newSize. |
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.ByteArrayOutputStream |
close, reset, size, toByteArray, toString, toString, toString, writeTo |
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SensibleByteArrayOutputStream
public SensibleByteArrayOutputStream()
- See Also:
ByteArrayOutputStream
SensibleByteArrayOutputStream
public SensibleByteArrayOutputStream(int size)
- Parameters:
size - the initial size of the byte array- See Also:
ByteArrayOutputStream
write
public void write(int b)
-
- Overrides:
write in class java.io.ByteArrayOutputStream
write
public void write(byte[] b,
int off,
int len)
-
- Overrides:
write in class java.io.ByteArrayOutputStream
assureSize
public void assureSize(int newSize)
- Resizes the buffer to ensure it is as large as newSize.
- Parameters:
newSize - the new minimum size of the buffer