protected final void readHeader(StreamDecoderInput in) {
        final int type = in.readUnsignedByte();
        if ((type & RESERVED_MASK) != 0) {
            throw new ArmeriaStatusException(
                    StatusCodes.INTERNAL,
                    DEBUG_STRING + ": Frame header malformed: reserved bits not zero");
        }

        // Update the required length to include the length of the frame.
        requiredLength = in.readInt();
        if (requiredLength < 0 || requiredLength > maxMessageLength) {
            throw new ArmeriaStatusException(
                    StatusCodes.RESOURCE_EXHAUSTED,
                    String.format("%s: Frame size %d exceeds maximum: %d. ",
                                  DEBUG_STRING, requiredLength,
                                  maxMessageLength));
        }

        // Store type and continue reading the frame body.
        currentType = type;
    }
Processes the gRPC compression header which is composed of the compression flag and the outer
frame length.
grpc-protocol/src/main/java/com/linecorp/armeria/common/grpc/protocol/AbstractMessageDeframer.java