Package dap4.servlet

Class SerialWriter

java.lang.Object
dap4.servlet.SerialWriter

public class SerialWriter extends Object
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 Details

    • DEBUG

      public static boolean DEBUG
    • DUMPDATA

      public static boolean DUMPDATA
    • DUMPCSUM

      public static boolean DUMPCSUM
    • order

      protected ByteOrder order
    • output

      protected OutputStream output
    • depth

      protected int depth
    • checksum

      protected Checksum checksum
    • checksummode

      protected dap4.core.util.ChecksumMode checksummode
    • serialize

      protected boolean serialize
    • lastchecksum

      protected long lastchecksum
    • crcbuffer

      protected ByteBuffer crcbuffer
    • countbuffer

      protected ByteBuffer countbuffer
  • Constructor Details

    • SerialWriter

      public SerialWriter(OutputStream output, ByteOrder order, dap4.core.util.ChecksumMode mode)
  • 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 object
      values - 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

      public void endVariable() throws IOException
      Throws:
      IOException
    • writeCount

      public void writeCount(long count) throws IOException
      Write out a prefix count
      Parameters:
      count - the count to write out
      Throws:
      IOException
    • writeAtomicArray

      public void writeAtomicArray(dap4.core.dmr.DapType daptype, Object values) throws IOException
      Write out an array of atomic values
      Parameters:
      daptype - type of the values
      values - the array of values
      Throws:
      IOException
    • writeBytes

      public void writeBytes(byte[] bytes, int len) throws IOException
      Write out a set of bytes
      Parameters:
      bytes -
      len -
      Throws:
      IOException
    • outputBytes

      public void outputBytes(byte[] bytes, int start, int count) throws IOException
      Deliberate choke point for debugging
      Parameters:
      bytes -
      start -
      count -
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Throws:
      IOException