use of org.neo4j.bolt.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(neo4jPack.newUnpacker(new BufferedChannelInput(16).reset(channel)));
BufferedChannelOutput output = new BufferedChannelOutput(channel);
BoltResponseMessageWriterV3 writer = new BoltResponseMessageWriterV3(neo4jPack::newPacker, output, NullLogService.getInstance());
writer.write(msg);
writer.flush();
channel.eof();
return unpack(reader, channel);
}
Aggregations