2019-03-17 23:39:54 +00:00
|
|
|
package org.capnproto;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An object that allocates memory for a Cap'n Proto message as it is being built.
|
|
|
|
*/
|
2019-05-20 22:12:19 +00:00
|
|
|
public interface Allocator {
|
2019-03-17 23:39:54 +00:00
|
|
|
/**
|
|
|
|
* Allocates a ByteBuffer to be used as a segment in a message. The returned
|
|
|
|
* buffer must contain at least `minimumSize` bytes, all of which MUST be
|
|
|
|
* set to zero.
|
|
|
|
*/
|
|
|
|
public java.nio.ByteBuffer allocateSegment(int minimumSize);
|
|
|
|
}
|