public class SerialWriter
extends java.lang.Object
Ideally, this class should be completely independent of CDM code so that Non-NetcdfDataset writers can be accomodated.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.zip.Checksum |
checksum |
protected dap4.core.data.ChecksumMode |
checksummode |
protected java.nio.ByteBuffer |
countbuffer |
protected java.nio.ByteBuffer |
crcbuffer |
static boolean |
DEBUG |
protected int |
depth |
static boolean |
DUMPCSUM |
static boolean |
DUMPDATA |
protected java.lang.String |
lastchecksum |
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,
dap4.core.data.ChecksumMode mode) |
| Modifier and Type | Method and Description |
|---|---|
static java.nio.ByteBuffer |
encodeArray(dap4.core.dmr.DapType vtype,
java.lang.Object values,
java.nio.ByteOrder order)
Encode an array of primitive values.
|
void |
endGroup() |
void |
endVariable() |
void |
flush() |
java.lang.String |
getLastChecksum() |
void |
noSerialize(boolean tf) |
void |
outputBytes(byte[] bytes,
int start,
int count)
Deliberate choke point for debugging
|
void |
startGroup() |
void |
startVariable() |
void |
writeAtomicArray(dap4.core.dmr.DapType daptype,
java.lang.Object values)
Write out an array of atomic values
|
void |
writeBytes(byte[] bytes,
int len)
Write out a set of bytes
|
void |
writeCount(long count)
Write out a prefix count
|
public static boolean DEBUG
public static boolean DUMPDATA
public static boolean DUMPCSUM
protected java.nio.ByteOrder order
protected java.io.OutputStream output
protected int depth
protected java.util.zip.Checksum checksum
protected dap4.core.data.ChecksumMode checksummode
protected boolean serialize
protected java.lang.String lastchecksum
protected java.nio.ByteBuffer crcbuffer
protected java.nio.ByteBuffer countbuffer
public SerialWriter(java.io.OutputStream output,
java.nio.ByteOrder order,
dap4.core.data.ChecksumMode mode)
public void noSerialize(boolean tf)
public java.lang.String getLastChecksum()
public static java.nio.ByteBuffer encodeArray(dap4.core.dmr.DapType vtype,
java.lang.Object values,
java.nio.ByteOrder order)
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 writeCount(long count)
throws java.io.IOException
count - the count to write outjava.io.IOExceptionpublic void writeAtomicArray(dap4.core.dmr.DapType daptype,
java.lang.Object values)
throws java.io.IOException
daptype - type of the valuesvalues - the array of valuesjava.io.IOExceptionpublic void writeBytes(byte[] bytes,
int len)
throws java.io.IOException
bytes - len - java.io.IOExceptionpublic void outputBytes(byte[] bytes,
int start,
int count)
throws java.io.IOException
bytes - start - count - java.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOException