protected static int chunkLengthForPayload(int payloadSize,
                                               boolean reserveNextChunkIdField) {
      if (reserveNextChunkIdField) {
        return AlignmentUtils.roundUpToInt64(payloadSize + HEADER_SIZE + NEXT_CHUNK_ID_SIZE);
      }
      else {
        return AlignmentUtils.roundUpToInt64(payloadSize + HEADER_SIZE);
      }
    }
protected static int chunkLengthForPayload(int payloadSize,
                                               boolean reserveNextChunkIdField)