Interface BinaryTypeDecoder

    • Method Detail

      • readSize

        int readSize​(ProtonBuffer buffer)
              throws DecodeException
        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.
        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

        int readSize​(InputStream stream)
              throws DecodeException
        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.
        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.
        Throws:
        DecodeException - if an error occurs while reading the binary size.