checkContentReadLength method

void checkContentReadLength(
  1. int length
)

Implementation

void checkContentReadLength(int length) {
  if (length < 0) {
    throw TProtocolError(
        TProtocolErrorType.NEGATIVE_SIZE, "Negative length $length");
  }
  if (stringLengthLimit_ > 0 && length > stringLengthLimit_) {
    throw TProtocolError(TProtocolErrorType.SIZE_LIMIT,
        "Length $length exceeds string length limit $stringLengthLimit_");
  }
}