Gets the byte-length of the value encoded in the given buffer at
the given index.
765120
function encodedLength(encodedBuffer, index) {
  let result = 0;

  while (encodedBuffer[index + result] >= 0x80) {
    result++;
  }

  result++; // to account for the last byte

  if (index + result > encodedBuffer.length) {
    // FIXME(sven): seems to cause false positives
    // throw new Error("integer representation too long");
  }

  return result;
}
861723
public ByteArray slice( int index, int length )
    {
        int oldLimit = bb.limit();
        bb.position( index );
        bb.limit( index + length );
        IoBuffer slice = bb.slice();
        bb.limit( oldLimit );
        return new BufferByteArray( slice )
        {

            @Override
            public void free()
            {
                // Do nothing.
            }
        };
    }
1318144
def get_value_length(byte):
    
    length_value = byte & length_type_mask
    return LengthTypes.to_ints.get(length_value, byte & length_mask)
1274969
public byte getValueAsByte(int index) throws IOException {
        if (index >= structure.valueSizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return value[index];
    }
781619
static int readInt(final byte[] b, final int index) {
        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
    }
330910
public String payload(int index) {
        return payload.size() > index ? payload.get(index) : null;
    }
764189
static int getInt(byte[] buffer, int offset) {
        return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8
                | (buffer[offset + 3] & 0xff);
    }
730351
public ByteBuffer toByteBuffer(int index, int length)
    {
        checkPositionIndexes(index, index + length, this.length);
        index += offset;
        return ByteBuffer.wrap(data, index, length).order(LITTLE_ENDIAN);
    }
51005
private int offset(long index) {
    int offset = (int) (index % buffer.length);
    if (offset < 0) {
      offset += buffer.length;
    }
    return offset;
  }
153280
public long getLong(final int index, final ByteOrder byteOrder)
    {
        boundsCheck0(index, SIZE_OF_LONG);

        long bits = UNSAFE.getLong(byteArray, ARRAY_BASE_OFFSET + index);
        if (NATIVE_BYTE_ORDER != byteOrder)
        {
            bits = Long.reverseBytes(bits);
        }

        return bits;
    }
584555
public byte getKeyAsByte(int index) throws IOException {
        if (index >= structure.keySizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return key[structure.keyByteOffsets.get(index)];
    }
648888
public byte getByte(final long index)
    {
        if (SHOULD_BOUNDS_CHECK)
        {
            boundsCheck(index);
        }

        return UNSAFE.getByte(null, addressOffset + index);
    }
115776
public ByteBuffer get4x3(int index, ByteBuffer buffer) {
        MemUtil.INSTANCE.put4x3(this, index, buffer);
        return buffer;
    }
540539
private byte getByte(int index) {
        if (index < initialSize) {
            return pool.get(0)[index];
        }
        
        index -= initialSize;
        return pool.get(index / incrementalSize + 1)[index % incrementalSize];
    }
933294
public static short getShort(ByteBuffer buf, int index) {
        return buf.order() == BIG_ENDIAN ? getShortB(buf, index) : getShortL(buf, index);
    }
148359
@Override
    public byte[] getBytes(int index) {
        String b64String = rows.get(row).getString(index);
        return Base64.getDecoder().decode(b64String);
    }
687192
int decode( byte[] buffer, int bufferIndex ) {
        int start = headerStart = bufferIndex;

        bufferIndex += readHeaderWireFormat( buffer, bufferIndex );
        bufferIndex += readAndXWireFormat( buffer, bufferIndex );

        length = bufferIndex - start;
        return length;
    }