use of org.neo4j.bolt.v1.packstream.BufferedChannelInput in project neo4j by neo4j.
the class BoltResponseMessageTest method serializeAndDeserialize.
private <T extends ResponseMessage> T serializeAndDeserialize(T msg) throws IOException {
RecordingByteChannel channel = new RecordingByteChannel();
BoltResponseMessageReader reader = new BoltResponseMessageReader(new Neo4jPack.Unpacker(new BufferedChannelInput(16).reset(channel)));
BoltResponseMessageWriter writer = new BoltResponseMessageWriter(new Neo4jPack.Packer(new BufferedChannelOutput(channel)), NO_BOUNDARY_HOOK);
msg.dispatch(writer);
writer.flush();
channel.eof();
return unpack(reader, channel);
}
use of org.neo4j.bolt.v1.packstream.BufferedChannelInput in project neo4j by neo4j.
the class BoltRequestMessageTest method serializeAndDeserialize.
private <T extends RequestMessage> T serializeAndDeserialize(T msg) throws IOException {
RecordingByteChannel channel = new RecordingByteChannel();
BoltRequestMessageReader reader = new BoltRequestMessageReader(new Neo4jPack.Unpacker(new BufferedChannelInput(16).reset(channel)));
BoltRequestMessageWriter writer = new BoltRequestMessageWriter(new Neo4jPack.Packer(new BufferedChannelOutput(channel)), NO_BOUNDARY_HOOK);
writer.write(msg).flush();
channel.eof();
return unpack(reader, channel);
}
Aggregations