org.intermine.sql.writebatch
Class PostgresByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by org.intermine.util.SensibleByteArrayOutputStream
              extended by org.intermine.sql.writebatch.PostgresByteArrayOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

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.


Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
PostgresByteArrayOutputStream()
           
PostgresByteArrayOutputStream(int size)
           
 
Method Summary
 byte[] getBuffer()
          Returns the byte buffer without copying it.
 
Methods inherited from class org.intermine.util.SensibleByteArrayOutputStream
assureSize, write, write
 
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
 

Constructor Detail

PostgresByteArrayOutputStream

public PostgresByteArrayOutputStream()
See Also:
ByteArrayOutputStream

PostgresByteArrayOutputStream

public PostgresByteArrayOutputStream(int size)
Parameters:
size - the initial size of the byte array
See Also:
ByteArrayOutputStream
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