File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
common/src/main/java/org/conscrypt Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ public abstract class BufferAllocator {
2828 public AllocatedBuffer allocateDirectBuffer (int capacity ) {
2929 return AllocatedBuffer .wrap (ByteBuffer .allocateDirect (capacity ));
3030 }
31+
32+ @ Override
33+ public AllocatedBuffer allocateHeapBuffer (int capacity ) {
34+ return AllocatedBuffer .wrap (ByteBuffer .allocate (capacity ));
35+ }
3136 };
3237
3338 /**
@@ -41,4 +46,9 @@ public static BufferAllocator unpooled() {
4146 * Allocates a direct (i.e. non-heap) buffer with the given capacity.
4247 */
4348 public abstract AllocatedBuffer allocateDirectBuffer (int capacity );
49+
50+ /**
51+ * Allocates a heap buffer with the given capacity.
52+ */
53+ public abstract AllocatedBuffer allocateHeapBuffer (int capacity );
4454}
You can’t perform that action at this time.
0 commit comments