Class HDTDictionarySectionPFC
java.lang.Object
org.eclipse.rdf4j.rio.hdt.HDTPart
org.eclipse.rdf4j.rio.hdt.HDTDictionarySection
org.eclipse.rdf4j.rio.hdt.HDTDictionarySectionPFC
HDT DictionarySection Plain Front Coding.
This part starts with a byte indicating the type of the dictionary section, followed by the VByte-encoded number of strings, the VByte-encoded buffer size and the VByte-encoded buffer length.
Then the 8-bit CRC.
Followed by an array and one or more buffers, and the 32-bit CRC calculated over the index and the buffers.
Structure:
+------+--------------+--------------+-------+------+-------+--------+...+-------+ | type | totalStrings | stringsBlock | array | CRC8 | index | buffer |...| CRC32 | +------+--------------+--------------+-------+------+-------+--------+...+-------+
Each buffer starts with a full string, followed by a maximum of stringsBlock - 1 pair of a VByte-encoded
number of characters this string has in common with the _previous_ string, and the (different) suffix.
E.g. abcdef 2 gh 3 ij will result in abcde, abgh, abgij.
Buffer structure:
+--------+--------+--------+...+--------+--------+ | string | common | suffix |...| common | suffix | +--------+--------+--------+...+--------+--------+
-
Nested Class Summary
Nested classes/interfaces inherited from class HDTDictionarySection
HDTDictionarySection.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HDTArrayprivate byte[]private final LinkedHashMap<Integer, ArrayList<byte[]>> private intprivate intFields inherited from class HDTPart
COOKIE, name, pos, properties -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHDTDictionarySectionPFC(String name, long pos) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprivate ArrayList<byte[]> decodeBlock(int block, int start) Parse a single blockprotected byte[]get(int i) Get the entryprotected voidparse(InputStream is) Parse from input streamprotected intsize()Get the sizeMethods inherited from class HDTPart
checkControl, checkCRC, checkFormat, countToNull, getDebugPartStr, getIntegerProperty, getProperties, getProperties, mapProperties, readToNull
-
Field Details
-
buffer
private byte[] buffer -
totalStrings
private int totalStrings -
stringsBlock
private int stringsBlock -
blockStarts
-
cache
-
-
Constructor Details
-
HDTDictionarySectionPFC
-
-
Method Details
-
size
protected int size()Description copied from class:HDTDictionarySectionGet the size- Specified by:
sizein classHDTDictionarySection- Returns:
-
get
Description copied from class:HDTDictionarySectionGet the entry- Specified by:
getin classHDTDictionarySection- Parameters:
i- zero-based index- Returns:
- Throws:
IOException
-
parse
Description copied from class:HDTPartParse from input stream- Specified by:
parsein classHDTPart- Parameters:
is-- Throws:
IOException
-
decodeBlock
Parse a single block- Parameters:
block- block numberstart- starting position- Returns:
- list of decoded byte strings
- Throws:
IOException
-