/** Returns a view of this structure's memory as an array of structures. * Note that this <code>Structure</code> must have a public, no-arg * constructor. If the structure is currently using auto-allocated * {@link Memory} backing, the memory will be resized to fit the entire * array. * @param size desired number of elements * @return array of Structure (individual elements will be of the * appropriate type, as will the Structure[]). */ public Structure[] toArray(int size) { return toArray((Structure[])Array.newInstance(getClass(), size)); }
throw new IllegalArgumentException("Structure array must have non-zero length"); } else if (ss[0] == null) { Structure.newInstance((Class<? extends Structure>) type).toArray(ss); return ss[0].getPointer(); } else {
@SuppressWarnings("unchecked") public S[] castToArray(int size) { return (S[])super.toArray(size); } public S[] castToArray() {
@SuppressWarnings("unchecked") public S[] castToArray(int size) { return (S[])super.toArray(size); } public S[] castToArray() {
@SuppressWarnings("unchecked") public S[] castToArray(com.sun.jna.Structure[] array) { return (S[])super.toArray(array); }
@SuppressWarnings("unchecked") public S[] castToArray(com.sun.jna.Structure[] array) { return (S[])super.toArray(array); }
first.read(); Structure[] tmp = first.toArray(sarray.length); for (int i=1;i < sarray.length;i++) { if (sarray[i] == null) {
/** * @deprecated use castToArray instead */ @Deprecated @SuppressWarnings("unchecked") @Override public S[] toArray(com.sun.jna.Structure[] array) { return (S[])super.toArray(array); }
Structure[] tmp = first.toArray(sbuf.length); for (int i=1;i < sbuf.length;i++) { if (sbuf[i] == null) {
/** * @deprecated use castToArray instead */ @Deprecated @SuppressWarnings("unchecked") @Override public S[] toArray(int size) { return (S[])super.toArray(size); } /**
/** * @deprecated use castToArray instead */ @Deprecated @SuppressWarnings("unchecked") @Override public S[] toArray(int size) { return (S[])super.toArray(size); } /**
/** * @deprecated use castToArray instead */ @Deprecated @SuppressWarnings("unchecked") @Override public S[] toArray(com.sun.jna.Structure[] array) { return (S[])super.toArray(array); }
/** Returns a view of this structure's memory as an array of structures. * Note that this <code>Structure</code> must have a public, no-arg * constructor. If the structure is currently using auto-allocated * {@link Memory} backing, the memory will be resized to fit the entire * array. * @param size desired number of elements * @return array of Structure (individual elements will be of the * appropriate type, as will the Structure[]). */ public Structure[] toArray(int size) { return toArray((Structure[])Array.newInstance(getClass(), size)); }
throw new IllegalArgumentException("Structure array must have non-zero length"); } else if (ss[0] == null) { Structure.newInstance(type).toArray(ss); return ss[0].getPointer(); } else {
first.read(); Structure[] tmp = first.toArray(sarray.length); for (int i=1;i < sarray.length;i++) { if (sarray[i] == null) {
Structure[] tmp = first.toArray(sbuf.length); for (int i=1;i < sbuf.length;i++) { if (sbuf[i] == null) {
Memory m = new Memory(size * ss.length); struct.useMemory(m); Structure[] tmp = struct.toArray(ss.length); for (int si=0;si < ss.length;si++) { ss[si] = tmp[si];