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
-
class HDTDictionarySectionPFC extends HDTDictionarySection
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 inabcde, 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
Fields Modifier and Type Field Description private HDTArray
blockStarts
private byte[]
buffer
private java.util.LinkedHashMap<java.lang.Integer,java.util.ArrayList<byte[]>>
cache
private int
stringsBlock
private int
totalStrings
-
Fields inherited from class org.eclipse.rdf4j.rio.hdt.HDTPart
COOKIE, name, pos, properties
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HDTDictionarySectionPFC(java.lang.String name, long pos)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.ArrayList<byte[]>
decodeBlock(int block, int start)
Parse a single blockprotected byte[]
get(int i)
Get the entryprotected void
parse(java.io.InputStream is)
Parse from input streamprotected int
size()
Get the size-
Methods inherited from class org.eclipse.rdf4j.rio.hdt.HDTPart
checkControl, checkCRC, checkFormat, countToNull, getDebugPartStr, getIntegerProperty, getProperties, getProperties, mapProperties, readToNull
-
-
-
-
Field Detail
-
buffer
private byte[] buffer
-
totalStrings
private int totalStrings
-
stringsBlock
private int stringsBlock
-
blockStarts
private HDTArray blockStarts
-
cache
private final java.util.LinkedHashMap<java.lang.Integer,java.util.ArrayList<byte[]>> cache
-
-
Method Detail
-
size
protected int size()
Description copied from class:HDTDictionarySection
Get the size- Specified by:
size
in classHDTDictionarySection
- Returns:
-
get
protected byte[] get(int i) throws java.io.IOException
Description copied from class:HDTDictionarySection
Get the entry- Specified by:
get
in classHDTDictionarySection
- Parameters:
i
- zero-based index- Returns:
- Throws:
java.io.IOException
-
parse
protected void parse(java.io.InputStream is) throws java.io.IOException
Description copied from class:HDTPart
Parse from input stream
-
decodeBlock
private java.util.ArrayList<byte[]> decodeBlock(int block, int start) throws java.io.IOException
Parse a single block- Parameters:
block
- block numberstart
- starting position- Returns:
- list of decoded byte strings
- Throws:
java.io.IOException
-
-