Packages
 In this topic

*Constructors

 

Packages   PreviousThis PackageNext
Package com.ms.dll   Previous This
Package
Next

 


Class ArrayWithOffset

public final class ArrayWithOffset
{
  // Constructors
  public ArrayWithOffset( Object objArray, int nOffsetBytes );
  public ArrayWithOffset( byte[] array, int nOffsetBytes );
  public ArrayWithOffset( short[] array, int nOffsetBytes );
  public ArrayWithOffset( int[] array, int nOffsetBytes );
  public ArrayWithOffset( long[] array, int nOffsetBytes );
  public ArrayWithOffset( float[] array, int nOffsetBytes );
  public ArrayWithOffset( double[] array, int nOffsetBytes );
  public ArrayWithOffset( char[] array, int nOffsetBytes );
  public ArrayWithOffset( boolean[] array, int nOffsetBytes );

  // Methods
  public Object getArray();
  public int getOffset();
}

This class is used to encapsulate a pointer into an array, for use with Microsoft® J/Direct™ methods. When used as a parameter to a J/Direct method, an object of type ArrayWithOffset will be marshaled to a pointer to the given byte offset in the given array. No bounds checks are performed on the offset given in the constructor. Objects of type ArrayWithOffset are immutable—once created, they cannot be modifed.

Constructors

ArrayWithOffset

public ArrayWithOffset( Object objArray, int nOffsetBytes );

Generic; expects an array of primitive type and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( byte[] array, int nOffsetBytes );

Expects a byte array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( short[] array, int nOffsetBytes );

Expects a short array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( int[] array, int nOffsetBytes );

Expects an integer array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( long[] array, int nOffsetBytes );

Expects a long array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( float[] array, int nOffsetBytes );

Expects a float array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( double[] array, int nOffsetBytes );

Expects a double array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( char[] array, int nOffsetBytes );

Expects a character array and an offset in bytes.

ArrayWithOffset

public ArrayWithOffset( boolean[] array, int nOffsetBytes );

Expects a boolean array and an offset in bytes.

Methods

getArray

public Object getArray();

Retrieves the wrapped array.

getOffset

public int getOffset();

Retrieves the offset, in bytes.