From 0104f0ff35304b0aa416c2caa7b53aadf592f36a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 30 Dec 2012 19:56:25 +0100 Subject: Fix Bug625: StructAccessor missing setShortsAt() and getShortsAt() methods for short[] For short[] Java code gets emitted for an StructAccessor object that uses: void setShortsAt(int i, short[] shorts) short[] getShortsAt(int i, short[] shorts) Problem was that StructAccessor.java had no such methods - added. --- src/java/com/jogamp/common/nio/StructAccessor.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/java/com/jogamp/common/nio/StructAccessor.java b/src/java/com/jogamp/common/nio/StructAccessor.java index 41da290..eef9dc5 100644 --- a/src/java/com/jogamp/common/nio/StructAccessor.java +++ b/src/java/com/jogamp/common/nio/StructAccessor.java @@ -225,6 +225,19 @@ public class StructAccessor { } return v; } + + public final void setShortsAt(int byteOffset, short[] v) { + for (int i = 0; i < v.length; i++, byteOffset+=2) { + bb.putShort(byteOffset, v[i]); + } + } + + public final short[] getShortsAt(int byteOffset, short[] v) { + for (int i = 0; i < v.length; i++, byteOffset+=2) { + v[i] = bb.getShort(byteOffset); + } + return v; + } public final void setIntsAt(int byteOffset, int[] v) { for (int i = 0; i < v.length; i++, byteOffset+=4) { -- cgit v1.2.3