Interface StreamDecoderInput

All Superinterfaces:
AutoCloseable, SafeCloseable

@UnstableApi public interface StreamDecoderInput extends SafeCloseable
An input of StreamDecoder which is used to read a stream of objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    getByte(int index)
    Returns a byte at the specified absolute index in this StreamDecoderInput.
    default boolean
    Returns whether this input contains any readable bytes.
    int
    Returns the number of readable bytes.
    byte
    Reads a byte from the readable bytes.
    void
    readBytes(byte[] dst)
    Reads data to the specified dst.
    readBytes(int length)
    Reads a newly retained slice of this ByteBuf from the readable bytes.
    int
    Reads a 32-bit integer from the readable bytes.
    long
    Reads a 64-bit long from the readable bytes.
    default short
    Reads an unsigned byte from the readable bytes.
    default int
    Reads an unsigned short from the readable bytes.
    void
    skipBytes(int length)
    Skips bytes of the specified length in this StreamDecoderInput.

    Methods inherited from interface com.linecorp.armeria.common.util.SafeCloseable

    close
  • Method Details

    • readableBytes

      int readableBytes()
      Returns the number of readable bytes.
    • isReadable

      default boolean isReadable()
      Returns whether this input contains any readable bytes.
    • readByte

      byte readByte()
      Reads a byte from the readable bytes.
    • readUnsignedByte

      default short readUnsignedByte()
      Reads an unsigned byte from the readable bytes.
    • readUnsignedShort

      default int readUnsignedShort()
      Reads an unsigned short from the readable bytes.
      Throws:
      IllegalStateException - if the readableBytes() is less than 2 bytes.
    • readInt

      int readInt()
      Reads a 32-bit integer from the readable bytes.
      Throws:
      IllegalStateException - if the readableBytes() is less than 4 bytes.
    • readLong

      long readLong()
      Reads a 64-bit long from the readable bytes.
      Throws:
      IllegalStateException - if the readableBytes() is less than 8 bytes.
    • readBytes

      ByteBuf readBytes(int length)
      Reads a newly retained slice of this ByteBuf from the readable bytes.
      Throws:
      IllegalStateException - if the specified length is greater than readableBytes()
    • readBytes

      void readBytes(byte[] dst)
      Reads data to the specified dst.
      Throws:
      IllegalStateException - if the length of the dst is greater than readableBytes()
    • getByte

      byte getByte(int index)
      Returns a byte at the specified absolute index in this StreamDecoderInput.
      Throws:
      IllegalStateException - if the specified index is greater than readableBytes()
    • skipBytes

      void skipBytes(int length)
      Skips bytes of the specified length in this StreamDecoderInput.
      Throws:
      IllegalStateException - if the specified length is greater than readableBytes()