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 valueIOException
public static ByteBuffer encodeObject(DapType vtype, Object value, ByteOrder order) throws IOException
vtype
- The type of the objectvalue
- The valueorder
- the byteorder to useIOException
public ByteBuffer encodeArray(DapType vtype, Object values) throws IOException
vtype
- The type of the objectvalues
- The value arrayIOException
public void startGroup()
public void endGroup()
public void startVariable()
public void endVariable() throws IOException
IOException
public void writeObject(DapType daptype, Object value) throws IOException
daptype
- the type of the objectvalue
- the object to write outIOException
public void writeCount(long count) throws IOException
count
- the count to write outIOException
public void writeArray(DapType daptype, Object values) throws IOException
daptype
- the type of the objectIOException
public void writeBytes(byte[] bytes) throws IOException
bytes
- to writeIOException
Copyright © 1999–2018 UCAR/Unidata. All rights reserved.