Package 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
,java.lang.AutoCloseable
- 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.- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description SensibleByteArrayOutputStream()
SensibleByteArrayOutputStream(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Method Detail
-
write
public void write(int b)
- Overrides:
write
in classjava.io.ByteArrayOutputStream
-
write
public void write(byte[] b, int off, int len)
- Overrides:
write
in classjava.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
-
-