/** * Copies {@code dst.length} ints from the memory pointed to by this * {@link MachineSizedUIntPtr} to {@code dst}. Does the proper * narrowing {@code long} to {@code int} conversion if running on a 64-bit * platform. * * @param dst the destination. */ public void get(int[] dst) { get(dst, 0, dst.length); }
/** * Copies {@code dst.length} longs from the memory pointed to by this * {@link MachineSizedUIntPtr} to {@code dst}. Does unsigned {@code int} to * {@code long} conversion if running on a 32-bit platform. * * @param dst the destination. */ public void get(long[] dst) { get(dst, 0, dst.length); }
/** * Copies {@code n} ints from the memory pointed to by this * {@link MachineSizedUIntPtr} to a new {@code int[]} instance. Does the * proper narrowing {@code long} to {@code int} conversion if running on a 64-bit * platform. * * @param n the number of ints to copy. * @return the {@code int[]}. */ public int[] toIntArray(int n) { int[] result = new int[n]; get(result); return result; }
public long[] getExtendedPixels() { MachineSizedUIntPtr left = new MachineSizedUIntPtr(); MachineSizedUIntPtr right = new MachineSizedUIntPtr(); MachineSizedUIntPtr top = new MachineSizedUIntPtr(); MachineSizedUIntPtr bottom = new MachineSizedUIntPtr(); getExtendedPixels(left, right, top, bottom); return new long[] {left.get(), right.get(), top.get(), bottom.get()}; } /*<methods>*/
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public long getNumberEnabledCiphers() throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = getNumberEnabledCiphers0(ptr); OSStatusException.throwIfNecessary(status); return ptr.get(); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public int getDatagramWriteSize() throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = getDatagramWriteSize0(ptr); OSStatusException.throwIfNecessary(status); return (int)ptr.get(); } /**
public byte[] decodeBytes(String key) { MachineSizedUIntPtr lengthPtr = new MachineSizedUIntPtr(); BytePtr bytesPtr = decodeBytes0(key, lengthPtr); return bytesPtr.toByteArray((int)lengthPtr.get()); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public long getNumberSupportedCiphers() throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = getNumberSupportedCiphers0(ptr); OSStatusException.throwIfNecessary(status); return ptr.get(); } /**
public byte[] decodeBytes() { MachineSizedUIntPtr lengthPtr = new MachineSizedUIntPtr(); BytePtr bytePtr = decodeBytes0(lengthPtr); return bytePtr.toByteArray((int)lengthPtr.get()); } public void encodeObject(String key, NSObject value) {
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public long getMaxDatagramRecordSize() throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = getMaxDatagramRecordSize0(ptr); OSStatusException.throwIfNecessary(status); return ptr.get(); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public int getBufferedReadSize() throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = getBufferedReadSize0(ptr); OSStatusException.throwIfNecessary(status); return (int)ptr.get(); } /**
/** * @since Available in iOS 4.0 and later. */ public @MachineSizedUInt long getMagicCookieSize() { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); getMagicCookie0(ptr); return ptr.get(); } /**
/** * @since Available in iOS 4.0 and later. */ public @MachineSizedUInt long getFormatListSize() { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); getFormatList0(ptr); return ptr.get(); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public long write(byte[] data) throws OSStatusException { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); OSStatus status = write0(VM.getArrayValuesAddress(data), data.length, ptr); OSStatusException.throwIfNecessary(status); return ptr.get(); } /**
/** * @since Available in iOS 4.0 and later. */ @WeaklyLinked public @MachineSizedUInt long getChannelLayoutSize() { MachineSizedUIntPtr ptr = new MachineSizedUIntPtr(); getChannelLayout0(ptr); return ptr.get(); } /**
public static String getMachineString () { BytePtr name = BytePtr.toBytePtrAsciiZ("hw.machine"); MachineSizedUIntPtr size = new MachineSizedUIntPtr(); sysctlbyname(name, null, size, null, 0); BytePtr machine = Struct.allocate(BytePtr.class, (int) size.get()); sysctlbyname(name, machine.as(VoidPtr.class), size, null, 0); return machine.toStringAsciiZ(); }
public static String getMachineString () { BytePtr name = BytePtr.toBytePtrAsciiZ("hw.machine"); MachineSizedUIntPtr size = new MachineSizedUIntPtr(); sysctlbyname(name, null, size, null, 0); BytePtr machine = Struct.allocate(BytePtr.class, (int) size.get()); sysctlbyname(name, machine.as(VoidPtr.class), size, null, 0); return machine.toStringAsciiZ(); }
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public short[] getEnabledCiphers() throws OSStatusException { ShortPtr ciphersPtr = new ShortPtr(); MachineSizedUIntPtr numCiphersPtr = new MachineSizedUIntPtr(); OSStatus status = getEnabledCiphers0(ciphersPtr, numCiphersPtr); OSStatusException.throwIfNecessary(status); return ciphersPtr.toShortArray((int)numCiphersPtr.get()); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public short[] getSupportedCiphers() throws OSStatusException { ShortPtr ciphersPtr = new ShortPtr(); MachineSizedUIntPtr numCiphersPtr = new MachineSizedUIntPtr(); OSStatus status = getSupportedCiphers0(ciphersPtr, numCiphersPtr); OSStatusException.throwIfNecessary(status); return ciphersPtr.toShortArray((int)numCiphersPtr.get()); } /**
/** * @throws OSStatusException * @since Available in iOS 5.0 and later. */ public byte[] read(int dataLength) throws OSStatusException { BytePtr dataPtr = Struct.allocate(BytePtr.class, dataLength); MachineSizedUIntPtr processedPtr = new MachineSizedUIntPtr(); OSStatus status = read0(dataPtr, dataLength, processedPtr); OSStatusException.throwIfNecessary(status); return dataPtr.toByteArray((int)processedPtr.get()); } /**