List of usage examples for io.netty.buffer PooledByteBufAllocator buffer
@Override public ByteBuf buffer(int initialCapacity, int maxCapacity)
From source file:com.weibo.api.motan.transport.netty4.yar.YarMessageHandlerWarpperTest.java
License:Apache License
private FullHttpRequest buildHttpRequest(YarRequest yarRequest, String requestPath) throws Exception { PooledByteBufAllocator allocator = new PooledByteBufAllocator(); ByteBuf buf = allocator.buffer(2048, 1024 * 1024); if (yarRequest != null) { buf.writeBytes(YarProtocol.toProtocolBytes(yarRequest)); }/*from www . j a va2 s .c o m*/ FullHttpRequest httpReqeust = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, requestPath, buf); return httpReqeust; }