Microsoft SDK for Java

ArrayWithOffset Class

The ArrayWithOffset class of the com.ms.dll package is used to encapsulate a pointer into an array for use with J/Direct methods.

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();
}

When used as a parameter to a J/Direct method, an ArrayWithOffset instance is 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. Instances of this class are immutable; once created, they cannot be modified.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.