Package org.intermine.sql.writebatch
Class PostgresByteArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- org.intermine.util.SensibleByteArrayOutputStream
-
- org.intermine.sql.writebatch.PostgresByteArrayOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class PostgresByteArrayOutputStream extends SensibleByteArrayOutputStream
A subclass of SensibleByteArrayOutputStream that has extra methods useful for reducing the memory footprint of the Postgres database write operations.- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description PostgresByteArrayOutputStream()
see ByteArrayOutputStreamPostgresByteArrayOutputStream(int size)
see ByteArrayOutputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBuffer()
Returns the byte buffer without copying it.-
Methods inherited from class org.intermine.util.SensibleByteArrayOutputStream
assureSize, write, write
-
-
-
-
Method Detail
-
getBuffer
public byte[] getBuffer()
Returns the byte buffer without copying it. Note that the buffer may be larger than the data written, so the contents of the buffer after the size are undefined. Also, the contents of the buffer may change if more data is written to this object.- Returns:
- a byte array
-
-