in src/main/java/com/gu/thrift/serializer/ByteBufferBackedInputStream.java [24:29]
public int read(byte[] bytes, int off, int len) throws IOException {
if (!_b.hasRemaining()) return -1;
len = Math.min(len, _b.remaining());
_b.get(bytes, off, len);
return len;
}