org.intermine.sql.writebatch
Class PostgresDataOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by org.intermine.sql.writebatch.PostgresDataOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class PostgresDataOutputStream
extends java.io.DataOutputStream

A subclass of DataOutputStream that has extra methods useful for reducing the memory footprint of the Postgres database write operations.


Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
PostgresDataOutputStream(java.io.OutputStream out)
           
 
Method Summary
protected  int writeLargeUTF(java.util.Collection<java.lang.String> strs)
          Writes the given Collection of Strings to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.
 int writeLargeUTF(java.lang.String str)
          Writes the given String to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.
 int writeLargeUTF(StringConstructor str)
          Writes the given StringConstructor to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

PostgresDataOutputStream

public PostgresDataOutputStream(java.io.OutputStream out)
Parameters:
out - the OutputStream to write to
See Also:
DataOutputStream
Method Detail

writeLargeUTF

public int writeLargeUTF(java.lang.String str)
                  throws java.io.IOException
Writes the given String to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.

Parameters:
str - the String
Returns:
the number of bytes written to the OutputStream
Throws:
java.io.IOException - if there is an error writing to the underlying OutputStream

writeLargeUTF

public int writeLargeUTF(StringConstructor str)
                  throws java.io.IOException
Writes the given StringConstructor to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.

Parameters:
str - the StringConstructor
Returns:
the number of bytes written to the OutputStream
Throws:
java.io.IOException - if there is an error writing to the underlying OutputStream

writeLargeUTF

protected int writeLargeUTF(java.util.Collection<java.lang.String> strs)
                     throws java.io.IOException
Writes the given Collection of Strings to the stream in modified UTF-8 format, following its length in bytes as a four-byte integer.

Parameters:
strs - the Collection of Strings
Returns:
the number of bytes written to the OutputStream
Throws:
java.io.IOException - if there is an error writing to the underlying OutputStream