use of org.apache.qpid.protonj2.buffer.ProtonByteBufferAllocator in project qpid-protonj2 by apache.
the class ImperativeClientTestCase method createEncodedMessage.
protected byte[] createEncodedMessage(Section<?>... body) {
Encoder encoder = CodecFactory.getEncoder();
ProtonBuffer buffer = new ProtonByteBufferAllocator().allocate();
for (Section<?> section : body) {
encoder.writeObject(buffer, encoder.newEncoderState(), section);
}
byte[] result = new byte[buffer.getReadableBytes()];
buffer.readBytes(result);
return result;
}
use of org.apache.qpid.protonj2.buffer.ProtonByteBufferAllocator in project qpid-protonj2 by apache.
the class ProtonEngineTestSupport method createEncodedMessage.
protected byte[] createEncodedMessage(Data... body) {
Encoder encoder = CodecFactory.getEncoder();
ProtonBuffer buffer = new ProtonByteBufferAllocator().allocate();
for (Data data : body) {
encoder.writeObject(buffer, encoder.newEncoderState(), data);
}
byte[] result = new byte[buffer.getReadableBytes()];
buffer.readBytes(result);
return result;
}
use of org.apache.qpid.protonj2.buffer.ProtonByteBufferAllocator in project qpid-protonj2 by apache.
the class ProtonEngineTestSupport method createEncodedMessage.
protected byte[] createEncodedMessage(Section<Object> body) {
Encoder encoder = CodecFactory.getEncoder();
ProtonBuffer buffer = new ProtonByteBufferAllocator().allocate();
encoder.writeObject(buffer, encoder.newEncoderState(), body);
byte[] result = new byte[buffer.getReadableBytes()];
buffer.readBytes(result);
return result;
}
use of org.apache.qpid.protonj2.buffer.ProtonByteBufferAllocator in project qpid-protonj2 by apache.
the class ProtonEngineTestSupport method createEncodedMessage.
protected byte[] createEncodedMessage(Section<?>... body) {
Encoder encoder = CodecFactory.getEncoder();
ProtonBuffer buffer = new ProtonByteBufferAllocator().allocate();
for (Section<?> section : body) {
encoder.writeObject(buffer, encoder.newEncoderState(), section);
}
byte[] result = new byte[buffer.getReadableBytes()];
buffer.readBytes(result);
return result;
}
use of org.apache.qpid.protonj2.buffer.ProtonByteBufferAllocator in project qpid-protonj2 by apache.
the class ImperativeClientTestCase method createEncodedMessage.
protected byte[] createEncodedMessage(Data... body) {
Encoder encoder = CodecFactory.getEncoder();
ProtonBuffer buffer = new ProtonByteBufferAllocator().allocate();
for (Data data : body) {
encoder.writeObject(buffer, encoder.newEncoderState(), data);
}
byte[] result = new byte[buffer.getReadableBytes()];
buffer.readBytes(result);
return result;
}
Aggregations