public final class MemoryEfficientByteArrayOutputStream extends ByteArrayOutputStream
buf, count| Constructor and Description |
|---|
MemoryEfficientByteArrayOutputStream(int size)
Creates a new byte array output stream, with a buffer capacity of
the specified size, in bytes.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Gets the bytes.
|
static MemoryEfficientByteArrayOutputStream |
serialize(Serializable serializable)
Factory method.
|
static MemoryEfficientByteArrayOutputStream |
serialize(Serializable serializable,
int estimatedPayloadSize)
Factory method
|
close, reset, size, toByteArray, toString, toString, toString, write, write, writeToflush, writepublic MemoryEfficientByteArrayOutputStream(int size)
size - the initial size.public byte[] getBytes()
public static MemoryEfficientByteArrayOutputStream serialize(Serializable serializable, int estimatedPayloadSize) throws IOException
serializable - any Object that implements SerializableestimatedPayloadSize - how many bytes is expected to be in the Serialized representationIOException - if something goes wrong with the Serializationpublic static MemoryEfficientByteArrayOutputStream serialize(Serializable serializable) throws IOException
serializable - any Object that implements SerializableIOException - if something goes wrong with the SerializationCopyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.