@Test public void testAllocateLargeBuffer() throws Exception { CronetWritableBufferAllocator allocator = new CronetWritableBufferAllocator(); WritableBuffer buffer = allocator.allocate(1024 * 1024 * 1024); assertEquals(1024 * 1024, buffer.writableBytes()); }
@Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); }
CronetWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); } }
CronetWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); } CronetWritableBufferAllocator(); }
CronetWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); } CronetWritableBufferAllocator(); @Override WritableBuffer allocate(int capacityHint); }
CronetWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); } CronetWritableBufferAllocator(); @Override WritableBuffer allocate(int capacityHint);  }