private void maybeCheckOverflow(@Nullable ByteBuf decoded, ByteBuf newBuf) {
        if (maxLength <= 0 || maxLength == Integer.MAX_VALUE) {
            return;
        }

        decodedLength += newBuf.readableBytes();
        if (decodedLength > maxLength) {
            if (decoded != null) {
                decoded.release();
            }
            newBuf.release();
            throw ContentTooLargeException.builder()
                                          .maxContentLength(maxLength)
                                          .transferred(decodedLength)
                                          .build();
        }
    }
Skeletal {@link StreamDecoder} implementation. Netty implementation used to allow
for incremental decoding using an {@link EmbeddedChannel}.
core/src/main/java/com/linecorp/armeria/common/encoding/AbstractStreamDecoder.java