diff options
author | Sven Gothel <[email protected]> | 2013-01-18 22:09:09 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-01-18 22:09:09 +0100 |
commit | 9bcec728aebc74c81cdd7c92aba5ac2706a7da19 (patch) | |
tree | 3da42feb0c52fea8b4ad4f62d7c6f9dfd75fe4ed /src/java/com/jogamp | |
parent | 2537f8816f39fdc47cd5aaedd747a7b12b94ca5e (diff) | |
parent | 2b7d1b1d25cb2cd73311ec9159b465f0391bf5e0 (diff) |
Merge remote-tracking branch 'xranby/gcj-gij'
Diffstat (limited to 'src/java/com/jogamp')
-rwxr-xr-x | src/java/com/jogamp/common/nio/Buffers.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java index 695dc47..4a5255e 100755 --- a/src/java/com/jogamp/common/nio/Buffers.java +++ b/src/java/com/jogamp/common/nio/Buffers.java @@ -359,11 +359,25 @@ public class Buffers { if (buf == null) { return true; } - if (buf instanceof Buffer) { - return ((Buffer) buf).isDirect(); + if (buf instanceof ByteBuffer) { + return ((ByteBuffer) buf).isDirect(); + } else if (buf instanceof IntBuffer) { + return ((IntBuffer) buf).isDirect(); + } else if (buf instanceof ShortBuffer) { + return ((ShortBuffer) buf).isDirect(); + } else if (buf instanceof FloatBuffer) { + return ((FloatBuffer) buf).isDirect(); + } else if (buf instanceof DoubleBuffer) { + return ((DoubleBuffer) buf).isDirect(); + } else if (buf instanceof LongBuffer) { + return ((LongBuffer) buf).isDirect(); + } else if (buf instanceof CharBuffer) { + return ((CharBuffer) buf).isDirect(); } else if (buf instanceof PointerBuffer) { return ((PointerBuffer) buf).isDirect(); - } + } else if (buf instanceof Buffer) { + throw new IllegalArgumentException("Unexpected buffer type Buffer.isDirect() operation is undefined"); + } throw new IllegalArgumentException("Unexpected buffer type " + buf.getClass().getName()); } |