org.jouvieje.bass.misc
Class PointerUtils

java.lang.Object
  extended byorg.jouvieje.bass.misc.PointerUtils

public class PointerUtils
extends java.lang.Object

Utility routines for dealing with Pointer.


Constructor Summary
PointerUtils()
           
 
Method Summary
static Pointer createSubView(Pointer pointer, int offset)
           
static java.nio.ByteBuffer createView(Pointer pointer, long capacityInBytes)
          Create a view of the Pointer object as a ByteBuffer object.
static int stringLength(Pointer pointer)
           
static java.lang.String toString(Pointer pointer)
          Retrieve the String value stored in a Pointer (null terminated string).
static java.lang.String toString(Pointer pointer, int offset, int length)
          Retrieve the String value stored in the Pointer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointerUtils

public PointerUtils()
Method Detail

createView

public static java.nio.ByteBuffer createView(Pointer pointer,
                                             long capacityInBytes)
Create a view of the Pointer object as a ByteBuffer object.

Parameters:
pointer - Pointer to view as a ByteBuffer.
capacityInBytes - capacity in BYTES of the buffer.
Returns:
the ByteBuffer view.

createSubView

public static Pointer createSubView(Pointer pointer,
                                    int offset)

toString

public static java.lang.String toString(Pointer pointer)
Retrieve the String value stored in a Pointer (null terminated string).

Parameters:
pointer - a Pointer that holds a String.
Returns:
the String stored in the Pointer.
null if no String is stored in the buffer.
See Also:
toString(Pointer, int, int)

toString

public static java.lang.String toString(Pointer pointer,
                                        int offset,
                                        int length)
Retrieve the String value stored in the Pointer.

Parameters:
pointer - a Pointer that holds a String.
offset - offset (in characters) from the current position in the Pointer.
length - length of the String to retrieve.
Returns:
the string stored in the Pointer.
See Also:
toString(Pointer), BufferUtils.toString(ByteBuffer, int, int)

stringLength

public static int stringLength(Pointer pointer)


NativeBass is an Open Source Project under GNU LGPL License
NativeBass Project - © Copyright 2007-2008 - Jérôme Jouvie (Jouvieje)
http://jerome.jouvie.free.fr/ - jerome.jouvie@gmail.com

(Documentation Copyright © Ian Luck - BASS - http://www.un4seen.com)