/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }
/** * Returns a {@link FloatBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 32-bit platforms. * * @param n the maximum number of floats the {@link FloatBuffer} can * read/write. This will be the {@link FloatBuffer}'s * <code>capacity</code>. * @return the {@link FloatBuffer}. * @throws IllegalStateException if this isn't a 32-bit platform. */ public FloatBuffer asFloatBuffer(int n) { if (_sizeOf() != 4) { throw new IllegalStateException("Not a 32-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 2) .order(ByteOrder.nativeOrder()).asFloatBuffer(); }
/** * Returns a {@link DoubleBuffer} which reads and writes to the same memory * location pointed to by this {@link MachineSizedFloatPtr}. Must only be * called on 64-bit platforms. * * @param n the maximum number of doubles the {@link DoubleBuffer} can * read/write. This will be the {@link DoubleBuffer}'s * <code>capacity</code>. * @return the {@link DoubleBuffer}. * @throws IllegalStateException if this isn't a 64-bit platform. */ public DoubleBuffer asDoubleBuffer(int n) { if (_sizeOf() != 8) { throw new IllegalStateException("Not a 64-bit platform"); } return VM.newDirectByteBuffer(getHandle(), n << 3) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); }