Package org.apache.tomcat.jni
Class Buffer
java.lang.Object
org.apache.tomcat.jni.Buffer
Provides utilities related to the use of directly allocated
 
ByteBuffer instances with native code.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic longaddress(ByteBuffer buf) Returns the memory address of the ByteBuffer.static ByteBuffercalloc(int num, int size) Deprecated.Unused.static ByteBuffercreate(long mem, int size) Deprecated.Unused.static voidfree(ByteBuffer buf) Deprecated.Unused.static ByteBuffermalloc(int size) Deprecated.Unused.static ByteBufferpalloc(long p, int size) Deprecated.Unused.static ByteBufferpcalloc(long p, int size) Deprecated.Unused.static longsize(ByteBuffer buf) Deprecated.Unused.
- 
Constructor Details- 
Bufferpublic Buffer()
 
- 
- 
Method Details- 
mallocDeprecated.Unused. Will be removed in Tomcat 10.1Allocate a new ByteBuffer from memory- Parameters:
- size- The amount of memory to allocate
- Returns:
- The ByteBuffer with allocated memory
 
- 
callocDeprecated.Unused. Will be removed in Tomcat 10.1Allocate a new ByteBuffer from memory and set all of the memory to 0- Parameters:
- num- Number of elements.
- size- Length in bytes of each element.
- Returns:
- The ByteBuffer with allocated memory
 
- 
pallocDeprecated.Unused. Will be removed in Tomcat 10.1Allocate a new ByteBuffer from a pool- Parameters:
- p- The pool to allocate from
- size- The amount of memory to allocate
- Returns:
- The ByteBuffer with allocated memory
 
- 
pcallocDeprecated.Unused. Will be removed in Tomcat 10.1Allocate a new ByteBuffer from a pool and set all of the memory to 0- Parameters:
- p- The pool to allocate from
- size- The amount of memory to allocate
- Returns:
- The ByteBuffer with allocated memory
 
- 
createDeprecated.Unused. Will be removed in Tomcat 10.1Allocate a new ByteBuffer from already allocated memory.
 Allocated memory must be provided from call to the Stdlib.alloc or Stdlib.calloc methods.- Parameters:
- mem- The memory to use
- size- The amount of memory to use
- Returns:
- The ByteBuffer with attached memory
 
- 
freeDeprecated.Unused. Will be removed in Tomcat 10.1Deallocates or frees a memory block used by ByteBuffer
 Warning : Call this method only on ByteBuffers that were created by calling Buffer.alloc or Buffer.calloc.- Parameters:
- buf- Previously allocated ByteBuffer to be freed.
 
- 
addressReturns the memory address of the ByteBuffer.- Parameters:
- buf- Previously allocated ByteBuffer.
- Returns:
- the memory address
 
- 
sizeDeprecated.Unused. Will be removed in Tomcat 10.1Returns the allocated memory size of the ByteBuffer.- Parameters:
- buf- Previously allocated ByteBuffer.
- Returns:
- the size
 
 
-