Package org.eclipse.rdf4j.rio.hdt
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 org.eclipse.rdf4j.rio.hdt.HDTDictionarySection
HDTDictionarySection.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HDTArray
private byte[]
private final LinkedHashMap
<Integer, ArrayList<byte[]>> private int
private int
Fields inherited from class org.eclipse.rdf4j.rio.hdt.HDTPart
COOKIE, name, pos, properties
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
HDTDictionarySectionPFC
(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 void
parse
(InputStream is) Parse from input streamprotected int
size()
Get the sizeMethods inherited from class org.eclipse.rdf4j.rio.hdt.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
Constructor- Parameters:
name
-pos
-
-
-
Method Details
-
size
protected int size()Description copied from class:HDTDictionarySection
Get the size- Specified by:
size
in classHDTDictionarySection
- Returns:
-
get
Description copied from class:HDTDictionarySection
Get the entry- Specified by:
get
in classHDTDictionarySection
- Parameters:
i
- zero-based index- Returns:
- Throws:
IOException
-
parse
Description copied from class:HDTPart
Parse from input stream- Specified by:
parse
in classHDTPart
- Parameters:
is
-- Throws:
IOException
-
decodeBlock
Parse a single block- Parameters:
block
- block numberstart
- starting position- Returns:
- list of decoded byte strings
- Throws:
IOException
-