# Uses of Interface
org.apache.datasketches.memory.WritableMemory

## Uses of WritableMemory in org.apache.datasketches.memory

Methods in org.apache.datasketches.memory that return WritableMemory
Modifier and Type
Method
Description
`static WritableMemory`
WritableMemory.`allocate(int capacityBytes)`
Creates on-heap WritableMemory with the given capacity and the native byte order.
`static WritableMemory`
WritableMemory.`allocate(int capacityBytes, ByteOrder byteOrder)`
Creates on-heap WritableMemory with the given capacity and the given byte order.
`static WritableMemory`
WritableMemory.`allocate(int capacityBytes, ByteOrder byteOrder, MemoryRequestServer memReqSvr)`
Creates on-heap WritableMemory with the given capacity and the given byte order.
`static WritableMemory`
WritableMemory.`allocateDirect(long capacityBytes, long alignmentBytes, ByteOrder byteOrder, MemoryRequestServer memReqSvr, ArenaPREVIEW arena)`
Allocates and provides access to capacityBytes directly in native (off-heap) memory.
`static WritableMemory`
WritableMemory.`allocateDirect(long capacityBytes, ArenaPREVIEW arena)`
Allocates and provides access to capacityBytes directly in native (off-heap) memory.
`static WritableMemory`
WritableMemory.`allocateDirect(long capacityBytes, MemoryRequestServer memReqSvr, ArenaPREVIEW arena)`
Allocates and provides access to capacityBytes directly in native (off-heap) memory.
`default WritableMemory`
WritableBuffer.`asWritableMemory()`
Convert this WritableBuffer to a WritableMemory.
`WritableMemory`
WritableBuffer.`asWritableMemory(ByteOrder byteOrder)`
Convert this WritableBuffer to a WritableMemory with the given byte order.
`WritableMemory`
DefaultMemoryRequestServer.`request(WritableMemory oldWmem, long newCapacityBytes)`
`WritableMemory`
MemoryRequestServer.`request(WritableMemory oldWmem, long newCapacityBytes)`
Request a new WritableMemory with the given newCapacityBytes.
`static WritableMemory`
WritableMemory.`writableMap(File file, long fileOffsetBytes, long capacityBytes, ByteOrder byteOrder, ArenaPREVIEW arena)`
Maps the specified portion of the given file into Memory for write operations.
`static WritableMemory`
WritableMemory.`writableMap(File file, ArenaPREVIEW arena)`
Maps the entire given file into native-ordered WritableMemory for write operations with Arena.ofConfined().
`default WritableMemory`
WritableMemory.`writableRegion(long offsetBytes, long capacityBytes)`
A writable region is a writable view of this object.
`WritableMemory`
WritableMemory.`writableRegion(long offsetBytes, long capacityBytes, ByteOrder byteOrder)`
A writable region is a writable view of this object.
`static WritableMemory`
WritableMemory.`writableWrap(byte[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(byte[] array, int offsetBytes, int lengthBytes, ByteOrder byteOrder)`
Wraps the given primitive array for write operations with the given byte order.
`static WritableMemory`
WritableMemory.`writableWrap(byte[] array, int offsetBytes, int lengthBytes, ByteOrder byteOrder, MemoryRequestServer memReqSvr)`
Wraps the given primitive array for write operations with the given byte order.
`static WritableMemory`
WritableMemory.`writableWrap(byte[] array, ByteOrder byteOrder)`
Wraps the given primitive array for write operations with the given byte order.
`static WritableMemory`
WritableMemory.`writableWrap(char[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(double[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(float[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(int[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(long[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(short[] array)`
Wraps the given primitive array for write operations assuming native byte order.
`static WritableMemory`
WritableMemory.`writableWrap(ByteBuffer byteBuffer)`
Provides a view of the given ByteBuffer for write operations.
`static WritableMemory`
WritableMemory.`writableWrap(ByteBuffer byteBuffer, ByteOrder byteOrder, MemoryRequestServer memReqSvr)`
Provides a view of the given ByteBuffer for write operations.
Methods in org.apache.datasketches.memory with parameters of type WritableMemory
Modifier and Type
Method
Description
`void`
Memory.`copyTo(long srcOffsetBytes, WritableMemory destination, long dstOffsetBytes, long lengthBytes)`
Copies bytes from a source range of this Memory to a destination range of the given Memory with the same semantics when copying between overlapping ranges of bytes as method `System.arraycopy(Object, int, Object, int, int)` has.
`WritableMemory`
DefaultMemoryRequestServer.`request(WritableMemory oldWmem, long newCapacityBytes)`
`WritableMemory`
MemoryRequestServer.`request(WritableMemory oldWmem, long newCapacityBytes)`
Request a new WritableMemory with the given newCapacityBytes.
`void`
DefaultMemoryRequestServer.`requestClose(WritableMemory wmemToClose)`
`void`
MemoryRequestServer.`requestClose(WritableMemory wmemToClose)`
Request to close the given WritableMemory.