use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class STriple method writeObject.
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
TProtocol protocol = TRDF.protocol(out);
RDF_Term tterm = new RDF_Term();
SerializerRDF.write(protocol, tterm, triple.getSubject());
SerializerRDF.write(protocol, tterm, triple.getPredicate());
SerializerRDF.write(protocol, tterm, triple.getObject());
TRDF.flush(protocol);
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class STriple method readObject.
private void readObject(java.io.ObjectInputStream in) throws IOException {
TProtocol protocol = TRDF.protocol(in);
RDF_Term tterm = new RDF_Term();
Node s = SerializerRDF.read(protocol, tterm);
Node p = SerializerRDF.read(protocol, tterm);
Node o = SerializerRDF.read(protocol, tterm);
triple = Triple.create(s, p, o);
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method fromBytes.
public static void fromBytes(byte[] buffer, RDF_Quad quad) throws TException {
TMemoryInputTransport transport = getInputTransport();
transport.reset(buffer);
TProtocol protocol = getInputProtocol();
quad.read(protocol);
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method fromBytes.
public static void fromBytes(byte[] buffer, RDF_Triple triple) throws TException {
TMemoryInputTransport transport = getInputTransport();
transport.reset(buffer);
TProtocol protocol = getInputProtocol();
triple.read(protocol);
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method toBytes.
public static byte[] toBytes(RDF_Triple triple) throws TException {
ByteArrayOutputStream output = getOutputStream();
output.reset();
TProtocol protocol = getOutputProtocol();
triple.write(protocol);
return output.toByteArray();
}
Aggregations