Package jadex.binary

Class StreamDecodingContext

    • Field Detail

      • is

        protected java.io.InputStream is
        The stream being decoded.
      • offset

        protected int offset
        Current offset marker
    • Constructor Detail

      • StreamDecodingContext

        public StreamDecodingContext​(java.io.InputStream is,
                                     java.util.List<IDecoderHandler> decoderhandlers,
                                     java.util.List<ITraverseProcessor> postprocessors,
                                     java.lang.Object usercontext,
                                     java.lang.ClassLoader classloader,
                                     IErrorReporter errorreporter,
                                     SerializationConfig config)
        Creates a new DecodingContext.
        Parameters:
        classloader - The classloader.
        content - The content being decoded.
      • StreamDecodingContext

        public StreamDecodingContext​(java.io.InputStream is,
                                     java.util.List<IDecoderHandler> decoderhandlers,
                                     java.util.List<ITraverseProcessor> postprocessors,
                                     java.lang.Object usercontext,
                                     java.lang.ClassLoader classloader,
                                     IErrorReporter errorreporter,
                                     SerializationConfig config,
                                     int offset)
        Creates a new DecodingContext with specific offset.
        Parameters:
        content - The content being decoded.
        offset - The offset.
    • Method Detail

      • readByte

        public byte readByte()
        Reads a byte from the buffer.
        Returns:
        A byte.
      • read

        public byte[] read​(int count)
        Reads a number of bytes from the buffer.
        Specified by:
        read in class AbstractDecodingContext
        Parameters:
        count - Number of bytes.
        Returns:
        Byte array with the bytes.
      • read

        public byte[] read​(byte[] array)
        Reads a number of bytes from the buffer and fills the array.
        Specified by:
        read in interface IDecodingContext
        Specified by:
        read in class AbstractDecodingContext
        Parameters:
        array - The byte array.
        Returns:
        The byte array for convenience.
      • read

        public byte[] read​(byte[] array,
                           int woffset,
                           int wlength)
        Reads a number of bytes from the buffer and fills the array.
        Specified by:
        read in class AbstractDecodingContext
        Parameters:
        array - The byte array.
        woffset - write offset.
        wlength - length to read.
        Returns:
        The byte array for convenience.
      • getCurrentOffset

        public int getCurrentOffset()
        Returns the current offset of the decoding process for debugging.
        Returns:
        Current offset.