Class MallocBytez

java.lang.Object
org.nustaq.offheap.bytez.malloc.MallocBytez
All Implemented Interfaces:
BasicBytez, ByteSink, ByteSource, Bytez

public class MallocBytez
extends Object
implements Bytez
Date: 17.11.13 Time: 00:01 implementation of Bytez interface using unsafe on raw allocated memory
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected long baseAdress  
    protected long length  
  • Constructor Summary

    Constructors 
    Constructor Description
    MallocBytez​(long adr, long len)  
  • Method Summary

    Modifier and Type Method Description
    byte[] asByteArray()  
    void clear()  
    boolean compareAndSwapInt​(long offset, int expect, int newVal)  
    boolean compareAndSwapLong​(long offset, long expect, long newVal)  
    void copyTo​(BasicBytez other, long otherByteIndex, long myByteIndex, long lenBytes)  
    boolean equals​(Object obj)  
    byte get​(long byteIndex)  
    void getArr​(long byteIndex, byte[] target, int elemoff, int numElems)
    copy to a byte array
    int getBALength()  
    int getBAOffsetIndex()  
    long getBaseAdress()  
    boolean getBool​(long byteIndex)  
    void getBooleanArr​(long byteIndex, boolean[] target, int elemoff, int numElems)
    see getArr
    char getChar​(long byteIndex)  
    void getCharArr​(long byteIndex, char[] target, int elemoff, int numElems)
    see getArr
    double getDouble​(long byteIndex)  
    void getDoubleArr​(long byteIndex, double[] target, int elemoff, int numElems)
    see getArr
    float getFloat​(long byteIndex)  
    void getFloatArr​(long byteIndex, float[] target, int elemoff, int numElems)
    see getArr
    int getInt​(long byteIndex)  
    void getIntArr​(long byteIndex, int[] target, int elemoff, int numElems)
    see getArr
    long getLength()  
    long getLong​(long byteIndex)  
    void getLongArr​(long byteIndex, long[] target, int elemoff, int numElems)
    see getArr
    short getShort​(long byteIndex)  
    void getShortArr​(long byteIndex, short[] target, int elemoff, int numElems)
    see getArr
    int hashCode()  
    long length()  
    BasicBytez newInstance​(long size)  
    void put​(long byteIndex, byte value)  
    void putBool​(long byteIndex, boolean val)  
    void putChar​(long byteIndex, char c)  
    void putDouble​(long byteIndex, double d)  
    void putFloat​(long byteIndex, float f)  
    void putInt​(long byteIndex, int i)  
    void putLong​(long byteIndex, long l)  
    void putShort​(long byteIndex, short s)  
    void set​(long byteIndex, byte[] source, int elemoff, int numElems)  
    void setBase​(long adr, long len)  
    void setBoolean​(long byteIndex, boolean[] o, int elemoff, int numElems)  
    void setChar​(long byteIndex, char[] source, int elemoff, int numElems)  
    void setDouble​(long byteIndex, double[] source, int elemoff, int numElems)  
    void setFloat​(long byteIndex, float[] source, int elemoff, int numElems)  
    void setInt​(long byteIndex, int[] source, int elemoff, int numElems)  
    void setLong​(long byteIndex, long[] source, int elemoff, int numElems)  
    void setShort​(long byteIndex, short[] source, int elemoff, int numElems)  
    MallocBytez slice​(long off, int len)  
    byte[] toBytes​(long startIndex, int len)  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait