public class SerializationOutputStream
extends java.io.DataOutputStream
Constructor and Description |
---|
SerializationOutputStream(java.io.OutputStream out) |
Modifier and Type | Method and Description |
---|---|
void |
setCompressionLevel(int compressionLevel)
Sets the compression level (1-9) when writing serializable fields using
gzip.
|
void |
writeCompressableField(byte[] field,
boolean compress)
Writes a field that can be compressed.
|
void |
writeField(byte[] field)
Writes a byte array (byte field) to the output stream.
|
void |
writeSerializable(ByteSerializable object)
Writes a
ByteSerializable object to this output stream. |
void |
writeSerializableCollection(java.util.Collection<? extends ByteSerializable> object) |
void |
writeSimpleMap(SimpleMap<?,? extends ByteSerializable> map) |
void |
writeString(java.lang.String field)
Writes a String to the output stream.
|
void |
writeStringCollection(java.util.Collection<java.lang.String> collection) |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public SerializationOutputStream(java.io.OutputStream out)
public void writeString(java.lang.String field) throws java.io.IOException
field
- The String to write to the output streamjava.io.IOException
public void writeField(byte[] field) throws java.io.IOException
field
- The byte array to write to the output streamjava.io.IOException
public void writeCompressableField(byte[] field, boolean compress) throws java.io.IOException
field
- The byte array to write to the streamcompress
- Whether the byte field should be compressed or not.java.io.IOException
public void writeSerializableCollection(java.util.Collection<? extends ByteSerializable> object) throws java.io.IOException
java.io.IOException
public void writeStringCollection(java.util.Collection<java.lang.String> collection) throws java.io.IOException
java.io.IOException
public void writeSimpleMap(SimpleMap<?,? extends ByteSerializable> map) throws java.io.IOException
java.io.IOException
public void writeSerializable(ByteSerializable object) throws java.io.IOException
ByteSerializable
object to this output stream. This
method is equivalent to simply calling object.serialize() directly, but
fits into the normal serialization "flow" a bit better because it matches
the other methods in this class.object
- ByteSerializable object to serialize.java.io.IOException
public void setCompressionLevel(int compressionLevel)
compressionLevel
- compression level this output stream will use
when writing compressible fields.