@@ -0,0 +1,1320 @@
+/*%0A * Copyright (c) 2016. emengjzs. All rights reserved.%0A */%0A%0Apackage emengjzs.emengdb.db;%0A%0A/**%0A * Created by emengjzs on 2016/12/20.%0A */%0A%0Aimport emengjzs.emengdb.util.Bits;%0A%0A/**%0A * InternalKey is used for the putting low-level key in skip list,%0A * which contains of original user key and other meta data such as%0A * the length of the key, seq number, etc.%0A *%0A * Here defines the encode and decode of the InternalKey.%0A *%0A */%0Apublic class InternalKeyCoder %7B%0A%0A    /* if need to compress the metadata of key and value, e.g. key.length*/%0A    private boolean useZipMetaData = true;%0A%0A    /* if need to add crc code of data */%0A    private boolean useCRCCheckData = true;%0A%0A%0A    public byte%5B%5D construct(long seq, ValueType type, byte%5B%5D key) %7B%0A        int byteLength = Integer.BYTES + key.length + Long.BYTES;%0A        byte%5B%5D  metaDataWithKeyBytes = new byte%5BbyteLength%5D;%0A%0A        Bits.putInt(metaDataWithKeyBytes, 0, key.length);%0A        Bits.putBytes(metaDataWithKeyBytes, 0 + Long.BYTES, key);%0A        Bits.putLong(metaDataWithKeyBytes, 0 + key.length + Long.BYTES, seq %3C%3C 8 %7C type.toByte());%0A%0A        return metaDataWithKeyBytes;%0A    %7D%0A%0A%0A    public byte%5B%5D extractUserKey(byte%5B%5D internalKey) %7B%0A        return null;%0A    %7D%0A%0A    long extractSeqAndType() %7B%0A        return 0;%0A    %7D%0A%0A    long extractSeq() %7B%0A        return 0;%0A    %7D%0A%0A%7D%0A

Add InternalKeyCoder.