Package dap4.servlet

Class DapSerializer

  • Direct Known Subclasses:
    Generator

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

      • dsp

        protected dap4.core.data.DSP dsp
      • ce

        protected dap4.core.ce.CEConstraint ce
      • checksummode

        protected dap4.core.data.ChecksumMode checksummode
    • Constructor Detail

      • DapSerializer

        public DapSerializer()
      • DapSerializer

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

      • writeVariable

        protected void writeVariable​(dap4.core.data.DataCursor data,
                                     SerialWriter dst)
                              throws IOException
        Parameters:
        data - - cursor referencing what to write
        dst - - where to write
        Throws:
        IOException
      • writeAtomicVariable

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

        protected void writeStructure​(dap4.core.data.DataCursor 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​(dap4.core.data.DataCursor 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​(dap4.core.data.DataCursor 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​(dap4.core.data.DataCursor 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​(dap4.core.data.DataCursor 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