Package dap4.servlet

Class 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 Detail

      • DEBUG

        public static boolean DEBUG
      • DUMPDATA

        public static boolean DUMPDATA
      • DUMPCSUM

        public static boolean DUMPCSUM
      • depth

        protected int depth
      • checksummode

        protected dap4.core.data.ChecksumMode checksummode
      • serialize

        protected boolean serialize
      • lastchecksum

        protected String lastchecksum
    • Constructor Detail

      • SerialWriter

        public SerialWriter​(OutputStream output,
                            ByteOrder order,
                            dap4.core.data.ChecksumMode mode)
    • Method Detail

      • noSerialize

        public void noSerialize​(boolean tf)
      • getLastChecksum

        public String 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()
      • 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