public final class MemoryUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
binarySearchLongs(Memory mem,
int fromLongIndex,
int toLongIndex,
long key)
Searches a range of the specified array of longs for the specified value using the binary
search algorithm.
|
static void |
copy(Memory source,
long srcOffsetBytes,
Memory destination,
long dstOffsetBytes,
long lengthBytes)
Deprecated.
Use
Memory.copy(long, Memory, long, long) instead. |
static Memory |
memoryRequestHandler(Memory origMem,
long newCapacityBytes,
boolean copy)
Exception handler for requesting a new Memory allocation of the given newCapacityBytes,
using the MemoryRequest callback interface.
|
@Deprecated public static void copy(Memory source, long srcOffsetBytes, Memory destination, long dstOffsetBytes, long lengthBytes)
Memory.copy(long, Memory, long, long) instead.source - the source MemorysrcOffsetBytes - the source offsetdestination - the destination MemorydstOffsetBytes - the destination offsetlengthBytes - the number of bytes to copypublic static int binarySearchLongs(Memory mem, int fromLongIndex, int toLongIndex, long key)
mem - the Memory to be searchedfromLongIndex - the index of the first element (inclusive) to be searchedtoLongIndex - the index of the last element (exclusive) to be searchedkey - the value to be searched forpublic static Memory memoryRequestHandler(Memory origMem, long newCapacityBytes, boolean copy)
origMem - The original Memory that needs to be replaced by a newly allocated Memory.newCapacityBytes - The required capacity of the new Memory.copy - if true, data from the origMem will be copied to the new Memory as space allows
and the origMemory will be requested to be freed.
If false, no copy will occur and the request to free the origMem will not occur.Copyright © 2015–2017 Yahoo! Inc.. All rights reserved.