Package dap4.servlet
Class SerialWriter
java.lang.Object
dap4.servlet.SerialWriter
The SerialWriter class
is intended to provide the API
through which various kinds of
data are written into the ChunkWriter.
Ideally, this class should be completely independent of CDM code so that Non-NetcdfDataset writers can be accomodated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Checksumprotected dap4.core.util.ChecksumModeprotected ByteBufferprotected ByteBufferstatic booleanprotected intstatic booleanstatic booleanprotected longprotected ByteOrderprotected OutputStreamprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionSerialWriter(OutputStream output, ByteOrder order, dap4.core.util.ChecksumMode mode) -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferencodeArray(dap4.core.dmr.DapType vtype, Object values, ByteOrder order) Encode an array of primitive values.voidendGroup()voidvoidflush()longvoidnoSerialize(boolean tf) voidoutputBytes(byte[] bytes, int start, int count) Deliberate choke point for debuggingvoidvoidvoidwriteAtomicArray(dap4.core.dmr.DapType daptype, Object values) Write out an array of atomic valuesvoidwriteBytes(byte[] bytes, int len) Write out a set of bytesvoidwriteCount(long count) Write out a prefix count
-
Field Details
-
DEBUG
public static boolean DEBUG -
DUMPDATA
public static boolean DUMPDATA -
DUMPCSUM
public static boolean DUMPCSUM -
order
-
output
-
depth
protected int depth -
checksum
-
checksummode
protected dap4.core.util.ChecksumMode checksummode -
serialize
protected boolean serialize -
lastchecksum
protected long lastchecksum -
crcbuffer
-
countbuffer
-
-
Constructor Details
-
SerialWriter
-
-
Method Details
-
noSerialize
public void noSerialize(boolean tf) -
getLastChecksum
public long getLastChecksum() -
encodeArray
public static ByteBuffer encodeArray(dap4.core.dmr.DapType vtype, Object values, ByteOrder order) throws IOException Encode an array of primitive values.- Parameters:
vtype- The type of the objectvalues- The value array- Returns:
- bytebuffer encoding of the array using the platform's native encoding.
- Throws:
IOException
-
startGroup
public void startGroup() -
endGroup
public void endGroup() -
startVariable
public void startVariable() -
endVariable
- Throws:
IOException
-
writeCount
Write out a prefix count- Parameters:
count- the count to write out- Throws:
IOException
-
writeAtomicArray
Write out an array of atomic values- Parameters:
daptype- type of the valuesvalues- the array of values- Throws:
IOException
-
writeBytes
Write out a set of bytes- Parameters:
bytes-len-- Throws:
IOException
-
outputBytes
Deliberate choke point for debugging- Parameters:
bytes-start-count-- Throws:
IOException
-
flush
- Throws:
IOException
-