public static class Boss.Writer
extends java.lang.Object
| Constructor and Description |
|---|
Writer() |
Writer(java.io.OutputStream outputStream)
Creates writer to write to the output stream.
|
Writer(java.io.OutputStream outputStream,
BiSerializer biSerializer)
Creates writer to write to the output stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
java.io.OutputStream |
getOut() |
void |
setStreamMode()
Turn encoder to stream mode (e.g.
|
byte[] |
toByteArray()
Return packed bytes.
|
Boss.Writer |
write(java.lang.Object... objects)
Serialize one or more objects.
|
Boss.Writer |
writeObject(java.lang.Object obj)
Serialize single object known to boss (e.g.
|
public Writer(java.io.OutputStream outputStream,
BiSerializer biSerializer)
outputStream - See setStreamMode()public Writer(java.io.OutputStream outputStream)
outputStream - See setStreamMode()public Writer()
public void setStreamMode()
throws java.io.IOException
Stream more pushes the special record to the stream so the decoder Reader will know the more. Before
entering stream mode it is theoretically possible to write some cached trees, but this feature is yet
untested.
java.io.IOExceptionpublic Boss.Writer write(java.lang.Object... objects) throws java.io.IOException
objects - any number of Objects known to BOSSjava.io.IOExceptionpublic Boss.Writer writeObject(java.lang.Object obj) throws java.io.IOException
ArrayList, HashMapobj - the root object to encodejava.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOut()
public byte[] toByteArray()
OutputStream was a ByteArrayOutputStream.
The default constructor Writer.Writer() does so.