Class Binary8TypeDecoder

All Implemented Interfaces:
BinaryTypeDecoder, PrimitiveTypeDecoder<Binary>, StreamTypeDecoder<Binary>, TypeDecoder<Binary>

public final class Binary8TypeDecoder extends AbstractBinaryTypeDecoder
Decoder of AMQP Binary values with length less than 255 from a byte stream.
  • Constructor Details

    • Binary8TypeDecoder

      public Binary8TypeDecoder()
  • Method Details

    • getTypeCode

      public int getTypeCode()
      Returns:
      the AMQP Encoding Code that this primitive type decoder can read.
    • readSize

      public int readSize(ProtonBuffer buffer) throws DecodeException
      Description copied from interface: BinaryTypeDecoder
      Reads the encoded size value for the encoded binary payload and returns it. The read is destructive and the TypeDecoder read methods cannot be called after this unless the ProtonBuffer is reset via a position marker. This method can be useful when the caller intends to manually read the binary payload from the given ProtonBuffer.
      Specified by:
      readSize in interface BinaryTypeDecoder
      Specified by:
      readSize in class AbstractBinaryTypeDecoder
      Parameters:
      buffer - the buffer from which the binary encoded size should be read.
      Returns:
      the size of the binary payload that is encoded in the given ProtonBuffer.
      Throws:
      DecodeException - if an error occurs while reading the binary size.
    • readSize

      public int readSize(InputStream stream)
      Description copied from interface: BinaryTypeDecoder
      Reads the encoded size value for the encoded binary payload and returns it. The read is destructive and the TypeDecoder read methods cannot be called after this unless the InputStream is reset via a position marker. This method can be useful when the caller intends to manually read the binary payload from the given InputStream.
      Specified by:
      readSize in interface BinaryTypeDecoder
      Specified by:
      readSize in class AbstractBinaryTypeDecoder
      Parameters:
      stream - the stream from which the binary encoded size should be read.
      Returns:
      the size of the binary payload that is encoded in the given InputStream.