void CompactProtocolReader::readMapBegin(
    TType& keyType,
    TType& valType,
    uint32_t& size) {
  int8_t kvType = 0;
  int32_t msize = 0;

  apache::thrift::util::readVarint(in_, msize);
  if (msize != 0) {
    readByte(kvType);
  }

  if (msize < 0) {
    TProtocolException::throwNegativeSize();
  } else if (container_limit_ && msize > container_limit_) {
    TProtocolException::throwExceededSizeLimit();
  }

  keyType = getType((int8_t)((uint8_t)kvType >> 4));
  valType = getType((int8_t)((uint8_t)kvType & 0xf));
  size = (uint32_t)msize;
}
void CompactProtocolReader::readMapBegin(
    TType& keyType,
    TType& valType,
    uint32_t& size) {
  int8_t kvType = 0;
  int32_t msize = 0;

  apache::thrift::util::readVarint(in_, msize);
  if (msize != 0) {
    readByte(kvType);
  }

  if (msize < 0) {
    TProtocolException::throwNegativeSize();
  } else if (container_limit_ && msize > container_limit_) {
    TProtocolException::throwExceededSizeLimit();
  }

  keyType = getType((int8_t)((uint8_t)kvType >> 4));
  valType = getType((int8_t)((uint8_t)kvType & 0xf));
  size = (uint32_t)msize;
}