org.bridj
Class PointerIO<T>

java.lang.Object
  extended by org.bridj.PointerIO<T>

public abstract class PointerIO<T>
extends Object

Helper class that knows how to read/write data from/to a Pointer.
End users don't need to use this class directly as (Pointer lets you work with Type and Class).

Author:
Olivier

Constructor Summary
PointerIO(Type targetType, int targetSize, Class<?> typedPointerClass)
           
 
Method Summary
 T castTarget(long peer)
           
 Object getArray(Pointer<T> pointer, long byteOffset, int length)
           
static
<T> PointerIO<Pointer<T>>
getArrayInstance(PointerIO<T> targetIO, long[] dimensions, int iDimension)
           
static PointerIO<Boolean> getBooleanInstance()
           
<B extends Buffer>
B
getBuffer(Pointer<T> pointer, long byteOffset, int length)
           
static
<P> PointerIO<P>
getBufferPrimitiveInstance(Buffer buffer)
           
static PointerIO<Byte> getByteInstance()
           
static PointerIO<Character> getCharInstance()
           
static PointerIO<CLong> getCLongInstance()
           
static PointerIO<Double> getDoubleInstance()
           
static PointerIO<Float> getFloatInstance()
           
static
<S extends StructObject>
PointerIO<S>
getInstance(StructIO s)
           
static
<P> PointerIO<P>
getInstance(Type type)
           
static PointerIO<Integer> getIntInstance()
           
static PointerIO<Long> getLongInstance()
           
static PointerIO<Pointer> getPointerInstance()
           
static
<T> PointerIO<Pointer<T>>
getPointerInstance(PointerIO<T> targetIO)
           
static
<T> PointerIO<Pointer<T>>
getPointerInstance(Type target)
           
static PointerIO<Short> getShortInstance()
           
static PointerIO<SizeT> getSizeTInstance()
           
static PointerIO<String> getStringInstance()
           
 long getTargetAlignment()
           
 long getTargetSize()
           
 Type getTargetType()
           
 Class<?> getTypedPointerClass()
           
 boolean isTypedPointer()
           
 void setArray(Pointer<T> pointer, long byteOffset, Object array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointerIO

public PointerIO(Type targetType,
                 int targetSize,
                 Class<?> typedPointerClass)
Method Detail

getArray

public Object getArray(Pointer<T> pointer,
                       long byteOffset,
                       int length)

getBuffer

public <B extends Buffer> B getBuffer(Pointer<T> pointer,
                                      long byteOffset,
                                      int length)

setArray

public void setArray(Pointer<T> pointer,
                     long byteOffset,
                     Object array)

castTarget

public T castTarget(long peer)

getTargetSize

public long getTargetSize()

getTargetAlignment

public long getTargetAlignment()

isTypedPointer

public boolean isTypedPointer()

getTypedPointerClass

public Class<?> getTypedPointerClass()

getTargetType

public Type getTargetType()

getPointerInstance

public static <T> PointerIO<Pointer<T>> getPointerInstance(Type target)

getPointerInstance

public static <T> PointerIO<Pointer<T>> getPointerInstance(PointerIO<T> targetIO)

getArrayInstance

public static <T> PointerIO<Pointer<T>> getArrayInstance(PointerIO<T> targetIO,
                                                         long[] dimensions,
                                                         int iDimension)

getInstance

public static <S extends StructObject> PointerIO<S> getInstance(StructIO s)

getInstance

public static <P> PointerIO<P> getInstance(Type type)

getIntInstance

public static PointerIO<Integer> getIntInstance()

getLongInstance

public static PointerIO<Long> getLongInstance()

getShortInstance

public static PointerIO<Short> getShortInstance()

getByteInstance

public static PointerIO<Byte> getByteInstance()

getCharInstance

public static PointerIO<Character> getCharInstance()

getFloatInstance

public static PointerIO<Float> getFloatInstance()

getDoubleInstance

public static PointerIO<Double> getDoubleInstance()

getBooleanInstance

public static PointerIO<Boolean> getBooleanInstance()

getCLongInstance

public static PointerIO<CLong> getCLongInstance()

getSizeTInstance

public static PointerIO<SizeT> getSizeTInstance()

getPointerInstance

public static PointerIO<Pointer> getPointerInstance()

getBufferPrimitiveInstance

public static <P> PointerIO<P> getBufferPrimitiveInstance(Buffer buffer)

getStringInstance

public static PointerIO<String> getStringInstance()


Copyright © 2009-2012. All Rights Reserved.