@Override
    default ByteBuf toByteBuf(HttpData in) {
        requireNonNull(in, "in");
        // HttpHeaders is handled as is by processXXXHeaders(), processTrailers().
        return in.byteBuf();
    }
Decodes a stream of {@link HttpObject}s to N objects.

<p>Follow the below steps to decode HTTP payload using {@link HttpDecoder}.
<ol>
  <li>Implement your decoding logic in {@link HttpDecoder}.
      <pre>{@code
      > class FixedLengthDecoder implements HttpDecoder<String> {
      >     private final int length;
      >
      >     FixedLengthDecoder(int length) {
      >         this.length = length;
      >     }
      >
      >     @Override
      >     public void process(HttpDecoderInput in, HttpDecoderOutput<String> out) {
      >         int remaining = in.readableBytes();
      >         if (remaining < length) {
      >             // The input is not enough to process. Waiting for more data.
      >             return;
      >         }
      >
      >         do {
      >             // Read data from 'HttpDecoderInput' and
      >             // write the processed result to 'HttpDecoderOutput'.
      >             ByteBuf buf = in.readBytes(length);
      >             out.add(buf.toString(StandardCharsets.UTF_8));
      >             // Should release the returned 'ByteBuf'
      >             buf.release();
      >             remaining -= length;
      >         } while (remaining >= length);
      >     }
      > }
      }</pre>
  </li>
  <li>Create a decoded {@link StreamMessage} using {@link HttpMessage#decode(HttpDecoder)}
      with the {@link HttpDecoder} instance.
      <pre>{@code
      FixedLengthDecoder decoder = new FixedLengthDecoder(11);
      HttpRequest req = ...;
      StreamMessage<String> decoded = req.decode(decoder);
      }</pre>
  </li>
  <li>Subscribe to the {@link Publisher} of the decoded data and connect to your business logic.
      <pre>{@code
      import reactor.core.publisher.Flux;
      Flux.from(decoded).map(...); // Consume and manipulate the decoded data.
      }</pre>
  </li>
</ol>

@param <T> the result type of being decoded
core/src/main/java/com/linecorp/armeria/common/stream/HttpDecoder.java