code: private void readHeader() {
          final int type = readUnsignedByte();
          if ((type & RESERVED_MASK) != 0) {
              throw new ArmeriaStatusException(
                      StatusCodes.INTERNAL,
                      DEBUG_STRING + ": Frame header malformed: reserved bits not zero");
          }
          compressedFlag = (type & COMPRESSED_FLAG_MASK) != 0;
  
          // Update the required length to include the length of the frame.
          requiredLength = readInt();
          if (requiredLength < 0 || requiredLength > maxMessageSizeBytes) {
              throw new ArmeriaStatusException(
                      StatusCodes.RESOURCE_EXHAUSTED,
                      String.format("%s: Frame size %d exceeds maximum: %d. ",
                                    DEBUG_STRING, requiredLength,
                                    maxMessageSizeBytes));
          }
  
          // Continue reading the frame body.
          state = State.BODY;
      }
docs: Processes the gRPC compression header which is composed of the compression flag and the outer
  frame length.