use of org.neo4j.bolt.messaging.BoltRequestMessageWriter in project neo4j by neo4j.
the class MessageConditions method serialize.
public static byte[] serialize(Neo4jPack neo4jPack, RequestMessage... messages) throws IOException {
RecordingByteChannel rawData = new RecordingByteChannel();
Neo4jPack.Packer packer = neo4jPack.newPacker(new BufferedChannelOutput(rawData));
BoltRequestMessageWriter writer = new BoltRequestMessageWriterV4(packer);
for (RequestMessage message : messages) {
writer.write(message);
}
writer.flush();
return rawData.getBytes();
}
use of org.neo4j.bolt.messaging.BoltRequestMessageWriter in project neo4j by neo4j.
the class BoltProtocolV43ComponentFactory method encode.
public static byte[] encode(Neo4jPack neo4jPack, RequestMessage... messages) throws IOException {
RecordingByteChannel rawData = new RecordingByteChannel();
Neo4jPack.Packer packer = neo4jPack.newPacker(new BufferedChannelOutput(rawData));
BoltRequestMessageWriter writer = requestMessageWriter(packer);
for (RequestMessage message : messages) {
writer.write(message);
}
writer.flush();
return rawData.getBytes();
}
use of org.neo4j.bolt.messaging.BoltRequestMessageWriter in project neo4j by neo4j.
the class BoltProtocolV41ComponentFactory method encode.
public static byte[] encode(Neo4jPack neo4jPack, RequestMessage... messages) throws IOException {
RecordingByteChannel rawData = new RecordingByteChannel();
Neo4jPack.Packer packer = neo4jPack.newPacker(new BufferedChannelOutput(rawData));
BoltRequestMessageWriter writer = requestMessageWriter(packer);
for (RequestMessage message : messages) {
writer.write(message);
}
writer.flush();
return rawData.getBytes();
}
use of org.neo4j.bolt.messaging.BoltRequestMessageWriter in project neo4j by neo4j.
the class BoltRequestMessageV3Test method serializeAndDeserialize.
private <T extends RequestMessage> T serializeAndDeserialize(T msg) throws Exception {
RecordingByteChannel channel = new RecordingByteChannel();
Neo4jPack.Packer packer = neo4jPack.newPacker(new BufferedChannelOutput(channel));
BoltRequestMessageWriter writer = new BoltRequestMessageWriterV3(packer);
writer.write(msg).flush();
channel.eof();
return unpack(channel);
}
use of org.neo4j.bolt.messaging.BoltRequestMessageWriter in project neo4j by neo4j.
the class BoltProtocolV4ComponentFactory method encode.
public static byte[] encode(Neo4jPack neo4jPack, RequestMessage... messages) throws IOException {
RecordingByteChannel rawData = new RecordingByteChannel();
Neo4jPack.Packer packer = neo4jPack.newPacker(new BufferedChannelOutput(rawData));
BoltRequestMessageWriter writer = requestMessageWriter(packer);
for (RequestMessage message : messages) {
writer.write(message);
}
writer.flush();
return rawData.getBytes();
}
Aggregations