|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.model.BigdataValueSerializer<V>
public class BigdataValueSerializer<V extends Value>
Helper class provides efficient stand-off serialization of RDF Value
objects.
| Field Summary | |
|---|---|
protected static String |
ERR_CODE
Error message indicates that the term code in the serialized record did not correspond to a known term code for an RDF value of the appropriate type (e.g., a URI code where an Literal code was expected). |
protected static String |
ERR_VERSION
Error message indicates that the version code in the serialized record did not correspond to a known serialization version for an RDF value. |
protected static short |
VERSION0
Version zero(0) of the serialization format. |
| Constructor Summary | |
|---|---|
BigdataValueSerializer(ValueFactory valueFactory)
Create an instance that will materialize objects using the caller's factory. |
|
| Method Summary | |
|---|---|
V |
deserialize(byte[] b)
Routine for efficient de-serialization of an RDF Value. |
V |
deserialize(DataInputBuffer in)
Routine for efficient de-serialization of a BigdataValue. |
protected V |
deserialize(short version,
byte termCode,
DataInput in)
Implements the de-serialization of a Literal, URI, or BNode. |
protected byte |
getTermCode(Value val)
Return the term code as defined by ITermIndexCodes for this type
of term. |
byte[] |
serialize(V val)
Routine for efficient serialization of an RDF Value. |
byte[] |
serialize(V val,
DataOutputBuffer out)
Variant which permits reuse of the same buffer. |
protected void |
serialize(V val,
short version,
byte termCode,
DataOutput out)
Implements the serialization of a Literal, URI, or BNode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final short VERSION0
protected static final String ERR_VERSION
protected static final String ERR_CODE
ITermIndexCodes.
| Constructor Detail |
|---|
public BigdataValueSerializer(ValueFactory valueFactory)
valueFactory - The value factory.| Method Detail |
|---|
public byte[] serialize(V val)
Value.
RuntimeException - if there is a IO problem#deserialize(byte[])}
public byte[] serialize(V val,
DataOutputBuffer out)
out - The buffer - the caller is responsible for resetting the
buffer before each invocation.
public V deserialize(byte[] b)
Value.
Note: This automatically uses the BigdataValueFactoryImpl to create
the BigdataValues from the de-serialized state so the factory
reference is always set on the returned BigdataValueImpl.
b - The byte[] containing the serialized data record.
BigdataValue.
RuntimeException - if there is an IO problem.#serialize()}public V deserialize(DataInputBuffer in)
BigdataValue.
Note: This automatically uses the BigdataValueFactoryImpl to create
the BigdataValues from the de-serialized state so the factory
reference is always set on the returned BigdataValueImpl.
b - An input stream from which the serialized data may be read.
BigdataValue.
RuntimeException - if there is an IO problem.#serialize()}
protected void serialize(V val,
short version,
byte termCode,
DataOutput out)
throws IOException
version - The serialization version number (which has already been
written on out by the caller).termCode - The byte encoding the type of term as defined by
ITermIndexCodes (this has already been written on
out by the caller).out - The data are written here.
IOException
protected V deserialize(short version,
byte termCode,
DataInput in)
throws IOException
Note: This automatically uses the BigdataValueFactoryImpl to create
the BigdataValues from the de-serialized state so the factory
reference is always set on the returned BigdataValueImpl.
version - The serialization version number (which has already been read
by the caller).termCode - The byte encoding the type of term as defined by
ITermIndexCodes (this has already been read by the
caller).in - The data are read from here.
IOExceptionprotected byte getTermCode(Value val)
ITermIndexCodes for this type
of term. This is used to places URIs, different types of literals, and
bnodes into disjoint parts of the key space for sort orders.
ITermIndexCodes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||