public class SerialWriter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.zip.Checksum |
checksum |
protected boolean |
checksumming |
static boolean |
DEBUG |
protected int |
depth |
protected java.lang.StringBuilder |
lastchecksum |
protected java.nio.ByteBuffer |
longbuffer |
protected java.nio.ByteOrder |
order |
protected java.io.OutputStream |
output |
protected boolean |
serialize |
| Constructor and Description |
|---|
SerialWriter(java.io.OutputStream output,
java.nio.ByteOrder order) |
| Modifier and Type | Method and Description |
|---|---|
void |
computeChecksums(boolean tf) |
java.nio.ByteBuffer |
encodeArray(dap4.core.dmr.DapType vtype,
java.lang.Object values)
Encode an array of primitive values.
|
java.nio.ByteBuffer |
encodeObject(dap4.core.dmr.DapType vtype,
java.lang.Object value)
Encode an array of primitive values.
|
static java.nio.ByteBuffer |
encodeObject(dap4.core.dmr.DapType vtype,
java.lang.Object value,
java.nio.ByteOrder order)
Encode an array of primitive values.
|
void |
endGroup() |
void |
endVariable() |
java.lang.String |
getLastChecksum() |
void |
noSerialize(boolean tf) |
void |
startGroup() |
void |
startVariable() |
void |
writeArray(dap4.core.dmr.DapType daptype,
java.lang.Object values)
Write out an array of values
|
void |
writeBytes(byte[] bytes)
Write out a single object
|
void |
writeCount(long count)
Write out a prefix count
|
void |
writeObject(dap4.core.dmr.DapType daptype,
java.lang.Object value)
Write out a single object
|
public static boolean DEBUG
protected java.nio.ByteOrder order
protected java.io.OutputStream output
protected int depth
protected java.util.zip.Checksum checksum
protected boolean checksumming
protected boolean serialize
protected java.lang.StringBuilder lastchecksum
protected java.nio.ByteBuffer longbuffer
public SerialWriter(java.io.OutputStream output,
java.nio.ByteOrder order)
public void computeChecksums(boolean tf)
public void noSerialize(boolean tf)
public java.lang.String getLastChecksum()
public java.nio.ByteBuffer encodeObject(dap4.core.dmr.DapType vtype,
java.lang.Object value)
throws java.io.IOException
vtype - The type of the objectvalue - The valuejava.io.IOExceptionpublic static java.nio.ByteBuffer encodeObject(dap4.core.dmr.DapType vtype,
java.lang.Object value,
java.nio.ByteOrder order)
throws java.io.IOException
vtype - The type of the objectvalue - The valueorder - the byteorder to usejava.io.IOExceptionpublic java.nio.ByteBuffer encodeArray(dap4.core.dmr.DapType vtype,
java.lang.Object values)
throws java.io.IOException
vtype - The type of the objectvalues - The value arrayjava.io.IOExceptionpublic void startGroup()
public void endGroup()
public void startVariable()
public void endVariable()
throws java.io.IOException
java.io.IOExceptionpublic void writeObject(dap4.core.dmr.DapType daptype,
java.lang.Object value)
throws java.io.IOException
daptype - the type of the objectvalue - the object to write outjava.io.IOExceptionpublic void writeCount(long count)
throws java.io.IOException
count - the count to write outjava.io.IOExceptionpublic void writeArray(dap4.core.dmr.DapType daptype,
java.lang.Object values)
throws java.io.IOException
daptype - the type of the objectjava.io.IOExceptionpublic void writeBytes(byte[] bytes)
throws java.io.IOException
bytes - to writejava.io.IOException