use of org.neo4j.bolt.messaging.BoltResponseMessageReader in project neo4j by neo4j.
the class MessageConditions method responseReader.
private static BoltResponseMessageReader responseReader(Neo4jPack neo4jPack, byte[] bytes) {
ByteBufInput byteBufInput = new ByteBufInput();
byteBufInput.start(Unpooled.wrappedBuffer(bytes));
return new BoltResponseMessageReader(neo4jPack.newUnpacker(byteBufInput));
}
use of org.neo4j.bolt.messaging.BoltResponseMessageReader in project neo4j by neo4j.
the class MessageConditions method responseMessage.
public static ResponseMessage responseMessage(Neo4jPack neo4jPack, byte[] bytes) throws IOException {
BoltResponseMessageReader unpacker = responseReader(neo4jPack, bytes);
BoltResponseMessageRecorder consumer = new BoltResponseMessageRecorder();
try {
unpacker.read(consumer);
return consumer.asList().get(0);
} catch (Throwable e) {
throw new IOException("Failed to deserialize response, '" + e.getMessage() + "'.\n" + "Raw data: \n" + HexPrinter.hex(bytes), e);
}
}
Aggregations