@Test public void testCapacityHasMinimum() { WritableBuffer buffer = allocator().allocate(100); assertEquals(0, buffer.readableBytes()); assertEquals(4096, buffer.writableBytes()); }
@Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint)); return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint)); }
NettyWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint)); return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint)); } }
NettyWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint)); return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint)); } NettyWritableBufferAllocator(ByteBufAllocator allocator); }
NettyWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint)); return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint)); } NettyWritableBufferAllocator(ByteBufAllocator allocator); @Override WritableBuffer allocate(int capacityHint); }
NettyWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint)); return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint)); } NettyWritableBufferAllocator(ByteBufAllocator allocator); @Override WritableBuffer allocate(int capacityHint);  }