public class SerialWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Checksum |
checksum |
protected boolean |
checksumming |
static boolean |
DEBUG |
protected int |
depth |
protected StringBuilder |
lastchecksum |
protected ByteBuffer |
longbuffer |
protected ByteOrder |
order |
protected OutputStream |
output |
protected boolean |
serialize |
| Constructor and Description |
|---|
SerialWriter(OutputStream output,
ByteOrder order) |
| Modifier and Type | Method and Description |
|---|---|
void |
computeChecksums(boolean tf) |
ByteBuffer |
encodeArray(DapType vtype,
Object values)
Encode an array of primitive values.
|
ByteBuffer |
encodeObject(DapType vtype,
Object value)
Encode an array of primitive values.
|
static ByteBuffer |
encodeObject(DapType vtype,
Object value,
ByteOrder order)
Encode an array of primitive values.
|
void |
endGroup() |
void |
endVariable() |
String |
getLastChecksum() |
void |
noSerialize(boolean tf) |
void |
startGroup() |
void |
startVariable() |
void |
writeArray(DapType daptype,
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(DapType daptype,
Object value)
Write out a single object
|
public static boolean DEBUG
protected ByteOrder order
protected OutputStream output
protected int depth
protected Checksum checksum
protected boolean checksumming
protected boolean serialize
protected StringBuilder lastchecksum
protected ByteBuffer longbuffer
public SerialWriter(OutputStream output, ByteOrder order)
public void computeChecksums(boolean tf)
public void noSerialize(boolean tf)
public String getLastChecksum()
public ByteBuffer encodeObject(DapType vtype, Object value) throws IOException
vtype - The type of the objectvalue - The valueIOExceptionpublic static ByteBuffer encodeObject(DapType vtype, Object value, ByteOrder order) throws IOException
vtype - The type of the objectvalue - The valueorder - the byteorder to useIOExceptionpublic ByteBuffer encodeArray(DapType vtype, Object values) throws IOException
vtype - The type of the objectvalues - The value arrayIOExceptionpublic void startGroup()
public void endGroup()
public void startVariable()
public void endVariable()
throws IOException
IOExceptionpublic void writeObject(DapType daptype, Object value) throws IOException
daptype - the type of the objectvalue - the object to write outIOExceptionpublic void writeCount(long count)
throws IOException
count - the count to write outIOExceptionpublic void writeArray(DapType daptype, Object values) throws IOException
daptype - the type of the objectIOExceptionpublic void writeBytes(byte[] bytes)
throws IOException
bytes - to writeIOExceptionCopyright © 1999–2014 UCAR/Unidata. All rights reserved.