Package dap4.servlet

Class DapSerializer


  • public class DapSerializer
    extends Object
    Given a DSP, serialize possibly constrained data.
    • Field Detail

      • cdmwrap

        protected CDMWrap cdmwrap
      • ce

        protected dap4.core.ce.CEConstraint ce
      • checksummode

        protected dap4.core.util.ChecksumMode checksummode
      • checksums

        protected Map<dap4.core.dmr.DapVariable,​Long> checksums
    • Constructor Detail

      • DapSerializer

        public DapSerializer()
      • DapSerializer

        public DapSerializer​(CDMWrap c4,
                             dap4.core.ce.CEConstraint constraint,
                             OutputStream stream,
                             ByteOrder order,
                             dap4.core.util.ChecksumMode mode)
                      throws IOException
        Primary constructor
        Parameters:
        c4 - The DSP to write
        constraint - Any applicable constraint
        stream - Write to this stream
        order - The byte order to use
        Throws:
        IOException
    • Method Detail

      • getChecksums

        public Map<dap4.core.dmr.DapVariable,​Long> getChecksums()
      • writeAtomicVariable

        protected void writeAtomicVariable​(CDMData data,
                                           SerialWriter dst)
                                    throws IOException
        Write out an atomic variable.
        Parameters:
        data -
        dst -
        Throws:
        dap4.core.util.DapException
        IOException
      • writeStructure

        protected void writeStructure​(CDMData data,
                                      SerialWriter dst)
                               throws IOException
        Write out a scalar or array structure instance
        Parameters:
        data -
        dst - - where to write
        Throws:
        dap4.core.util.DapException
        IOException
      • writeStructure1

        protected void writeStructure1​(CDMData instance,
                                       SerialWriter dst)
                                throws IOException
        Write out a single structure instance
        Parameters:
        instance -
        dst - - where to write
        Throws:
        dap4.core.util.DapException
        IOException
      • writeSequence

        protected void writeSequence​(CDMData data,
                                     SerialWriter dst)
                              throws IOException
        Write out a single or array sequence instance
        Parameters:
        data -
        dst - - where to write
        Throws:
        dap4.core.util.DapException
        IOException
      • writeSequence1

        protected void writeSequence1​(CDMData instance,
                                      SerialWriter dst)
                               throws IOException
        Write out a single Sequence of records (Eventually use any filter in the DapVariable)
        Parameters:
        instance - the sequence instance
        dst - write target
        Throws:
        dap4.core.util.DapException
        IOException
      • writeRecord

        protected void writeRecord​(CDMData record,
                                   SerialWriter dst)
                            throws IOException
        Write out a single Record instance.
        Parameters:
        record - the record data cursor
        dst - to which to write
        Throws:
        dap4.core.util.DapException
        IOException