summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/com/jogamp/common/nio/StructAccessor.java13
1 files changed, 13 insertions, 0 deletions
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) {