use of com.firenio.buffer.ByteBuf in project baseio by generallycloud.
the class TestBytebufPut method testput0.
@Test
public void testput0() {
ByteBuf src = ByteBuf.direct(1024);
src.writeBytes(data.getBytes());
ByteBuf dst = ByteBuf.direct(1024);
dst.writeBytes(src);
v(dst);
}
use of com.firenio.buffer.ByteBuf in project baseio by generallycloud.
the class TestExpansion method directUnPool.
@Test
public void directUnPool() {
ByteBuf buf = ByteBuf.direct(2);
for (int i = 0; i < 10; i++) {
buf.writeBytes(data);
buf.writeByte(a);
}
Assert.assertTrue(v(buf));
}
use of com.firenio.buffer.ByteBuf in project baseio by generallycloud.
the class TestExpansion method arrayUnPool.
@Test
public void arrayUnPool() {
ByteBuf buf = ByteBuf.heap(2);
buf.clear();
for (int i = 0; i < 10; i++) {
buf.writeBytes(data);
buf.writeByte(a);
}
Assert.assertTrue(v(buf));
}
use of com.firenio.buffer.ByteBuf in project baseio by generallycloud.
the class TestByteBufPool method main.
public static void main(String[] args) throws Exception {
ChannelConnector context = new ChannelConnector("192.168.1.102", 6500);
context.addChannelEventListener(new LoggerChannelOpenListener());
context.addProtocolCodec(new LengthValueCodec());
Channel ch = context.connect(3000);
ByteBuf buf = ch.allocate();
ch.close();
buf.release();
}
use of com.firenio.buffer.ByteBuf in project baseio by generallycloud.
the class TestByteBufCopy method arrayPutDirect.
Object arrayPutDirect() {
ByteBuf buf = _array();
buf.writeBytes(directData());
return buf;
}
Aggregations