Class DeframedMessage

java.lang.Object
com.linecorp.armeria.common.grpc.protocol.DeframedMessage
All Implemented Interfaces:
com.linecorp.armeria.common.util.SafeCloseable, AutoCloseable

@UnstableApi public final class DeframedMessage extends Object implements com.linecorp.armeria.common.util.SafeCloseable
A deframed message. For uncompressed messages, we have the entire buffer available and return it as is in buf to optimize parsing. For compressed messages, we will parse incrementally and thus return an InputStream in stream.
  • Constructor Details

    • DeframedMessage

      public DeframedMessage(io.netty.buffer.ByteBuf buf, int type)
      Creates a new instance with the specified ByteBuf and type.
    • DeframedMessage

      public DeframedMessage(InputStream stream, int type)
      Creates a new instance with the specified InputStream and type.
  • Method Details

    • buf

      @Nullable public @Nullable io.netty.buffer.ByteBuf buf()
      Returns the ByteBuf.
      Returns:
      the ByteBuf, or null if not created with DeframedMessage(ByteBuf, int).
    • stream

      @Nullable public @Nullable InputStream stream()
      Returns the InputStream.
      Returns:
      the InputStream, or null if not created with DeframedMessage(InputStream, int).
    • isTrailer

      public boolean isTrailer()
      Returns true if this message is trailer.
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface com.linecorp.armeria.common.util.SafeCloseable