public class BigdataValueSerializer<V extends org.openrdf.model.Value> extends Object
Value
objects.Modifier and Type | Field and Description |
---|---|
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.
|
Constructor and Description |
---|
BigdataValueSerializer(org.openrdf.model.ValueFactory valueFactory)
Create an instance that will materialize objects using the caller's
factory.
|
Modifier and Type | Method and Description |
---|---|
V |
deserialize(byte[] b)
Routine for efficient de-serialization of an RDF
Value . |
V |
deserialize(DataInputBuffer in,
StringBuilder tmp)
Routine for efficient de-serialization of a
BigdataValue . |
static long |
getStringLength(org.openrdf.model.Value v)
Return the total #of characters in the RDF
Value . |
byte[] |
serialize(V val)
Routine for efficient serialization of an RDF
Value . |
byte[] |
serialize(V val,
DataOutputBuffer out,
ByteArrayBuffer tmp)
Variant which permits reuse of the same buffer.
|
void |
serialize2(V val,
DataOutputBuffer out,
ByteArrayBuffer tmp)
Variant which permits reuse of the same buffer and avoids copying the
data once it has been formated onto the caller's
DataOutputBuffer
(core impl). |
protected static final String ERR_VERSION
protected static final String ERR_CODE
ITermIndexCodes
.public BigdataValueSerializer(org.openrdf.model.ValueFactory valueFactory)
valueFactory
- The value factory.public byte[] serialize(V val)
Value
.RuntimeException
- if there is a IO problem#deserialize(byte[])}
public byte[] serialize(V val, DataOutputBuffer out, ByteArrayBuffer tmp)
val
- The value.out
- The buffer - the caller is responsible for resetting the
buffer before each invocation.tmp
- A buffer used to compress the component Unicode strings. This
will be reset as necessary by this method. It will be lazily
allocated if null
.public void serialize2(V val, DataOutputBuffer out, ByteArrayBuffer tmp)
DataOutputBuffer
(core impl).val
- The value.out
- The buffer - the caller is responsible for resetting the
buffer before each invocation.tmp
- A buffer used to compress the component Unicode strings. This
will be reset as necessary by this method. It will be lazily
allocated if null
.public V deserialize(byte[] b)
Value
.
Note: This automatically uses the BigdataValueFactoryImpl
to create
the BigdataValue
s 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, StringBuilder tmp)
BigdataValue
.
Note: This automatically uses the BigdataValueFactoryImpl
to
create the BigdataValue
s 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.tmp
- A buffer used to decode the component Unicode strings. The
length of the buffer will be reset as necessary by this
method.BigdataValue
.RuntimeException
- if there is an IO problem.#serialize()}
public static long getStringLength(org.openrdf.model.Value v)
Value
.v
- The Value
.Value
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.