use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method getInputProtocol.
private static TProtocol getInputProtocol() {
TProtocol protocol = inputProtocols.get();
if (protocol != null)
return protocol;
protocol = new TCompactProtocol(getInputTransport());
inputProtocols.set(protocol);
return protocol;
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method toBytes.
public static byte[] toBytes(RDF_Quad quad) throws TException {
ByteArrayOutputStream output = getOutputStream();
output.reset();
TProtocol protocol = getOutputProtocol();
quad.write(protocol);
return output.toByteArray();
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method fromBytes.
public static void fromBytes(byte[] bs, RDF_Term term) throws TException {
TMemoryInputTransport transport = getInputTransport();
transport.reset(bs);
TProtocol protocol = getInputProtocol();
term.read(protocol);
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method getOutputProtocol.
private static TProtocol getOutputProtocol() {
TProtocol protocol = outputProtocols.get();
if (protocol != null)
return protocol;
protocol = new TCompactProtocol(getOutputTransport());
outputProtocols.set(protocol);
return protocol;
}
use of org.apache.thrift.protocol.TProtocol in project jena by apache.
the class ThriftConverter method toBytes.
public static byte[] toBytes(RDF_Term term) throws TException {
ByteArrayOutputStream output = getOutputStream();
output.reset();
TProtocol protocol = getOutputProtocol();
term.write(protocol);
return output.toByteArray();
}
Aggregations