public byte [ ] get ( byte [ ] key ) throws IOException { int keyLength = key . length ; if ( keyLength >= slots . length || keyCounts [ keyLength ] == 0 ) { return null ; } long hash = ( long ) hashUtils . hash ( key ) ; int numSlots = slots [ keyLength ] ; int slotSize = slotSizes [ keyLength ] ; int indexOffset = indexOffsets [ keyLength ] ; long dataOffset = dataOffsets [ keyLength ] ; for ( int probe = 0 ; probe < numSlots ; probe ++ ) { int slot = ( int ) ( ( hash + probe ) % numSlots ) ; indexBuffer . position ( indexOffset + slot * slotSize ) ; indexBuffer . get ( slotBuffer , 0 , slotSize ) ; long offset = LongPacker . unpackLong ( slotBuffer , keyLength ) ; if ( offset == 0 ) { return null ; } if ( isKey ( slotBuffer , key ) ) { byte [ ] value = mMapData ? getMMapBytes ( dataOffset + offset ) : getDiskBytes ( dataOffset + offset ) ; return value ; } } return null ; }
Get the value for the given key or null