Package org.intermine.sql.writebatch
Class PostgresDataOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.DataOutputStream
-
- org.intermine.sql.writebatch.PostgresDataOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.DataOutput
,java.io.Flushable
,java.lang.AutoCloseable
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.- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description PostgresDataOutputStream(java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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(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
-
-
-
-
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
-
-