core/src/main/java/com/twitter/elephantbird/thrift/ThriftBinaryDeserializer.java
public void deserialize(TBase base, byte[] bytes, int offset, int len) throws TException {

    // If incoming payload is larger than threshold then adjust the threshold by making it 10% more
    // than incoming payload-length and re-initialize object. This generally should not happen.
    if (len > lengthLimit) {
      lengthLimit = len + Double.valueOf(0.1 * len).longValue();
      protocol = new ThriftBinaryProtocol(trans, lengthLimit, lengthLimit);
    }

    resetAndInitialize(protocol, len);
    trans.reset(bytes, offset, len);
    base.read(protocol);
  }
public void deserialize(TBase base, byte[] bytes, int offset, int len) throws TException {

    // If incoming payload is larger than threshold then adjust the threshold by making it 10% more
    // than incoming payload-length and re-initialize object. This generally should not happen.
    if (len > lengthLimit) {
      lengthLimit = len + Double.valueOf(0.1 * len).longValue();
      protocol = new ThriftBinaryProtocol(trans, lengthLimit, lengthLimit);
    }

    resetAndInitialize(protocol, len);
    trans.reset(bytes, offset, len);
    base.read(protocol);
  }
Same as {@link #deserialize(TBase, byte[])}, but much more buffer copy friendly.