private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry)
    {
        requireNonNull(data, "data is null");

        // read entry header
        int sharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);
        int nonSharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);
        int valueLength = VariableLengthQuantity.readVariableLengthInt(data);

        // read key
        Slice key = Slices.allocate(sharedKeyLength + nonSharedKeyLength);
        SliceOutput sliceOutput = key.output();
        if (sharedKeyLength > 0) {
            checkState(previousEntry != null, "Entry has a shared key but no previous entry was provided");
            sliceOutput.writeBytes(previousEntry.getKey(), 0, sharedKeyLength);
        }
        sliceOutput.writeBytes(data, nonSharedKeyLength);

        // read value
        Slice value = data.readSlice(valueLength);

        return new BlockEntry(key, value);
    }
private static BlockEntry readEntry ( SliceInput data , BlockEntry previousEntry ) { requireNonNull ( data , "data is null" ) ; int sharedKeyLength = VariableLengthQuantity . readVariableLengthInt ( data ) ; int nonSharedKeyLength = VariableLengthQuantity . readVariableLengthInt ( data ) ; int valueLength = VariableLengthQuantity . readVariableLengthInt ( data ) ; Slice key = Slices . allocate ( sharedKeyLength + nonSharedKeyLength ) ; SliceOutput sliceOutput = key . output ( ) ; if ( sharedKeyLength > 0 ) { checkState ( previousEntry != null , "Entry has a shared key but no previous entry was provided" ) ; sliceOutput . writeBytes ( previousEntry . getKey ( ) , 0 , sharedKeyLength ) ; } sliceOutput . writeBytes ( data , nonSharedKeyLength ) ; Slice value = data . readSlice ( valueLength ) ; return new BlockEntry ( key , value ) ; }
Reads the entry at the current data readIndex.
After this method, data readIndex is positioned at the beginning of the next entry
or at the end of data if there was not a next entry.

@return true if an entry was read