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();
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class TRDF method protocol.
/**
* Create Thrift protocol for the InputStream.
* @param in InputStream
*/
public static TProtocol protocol(InputStream in) {
try {
if (!(in instanceof BufferedInputStream))
in = new BufferedInputStream(in, InputBufferSize);
TTransport transport = new TIOStreamTransport(in);
transport.open();
TProtocol protocol = protocol(transport);
return protocol;
} catch (TException ex) {
TRDF.exception(ex);
return null;
}
}
Aggregations