diff options
Diffstat (limited to 'src/java/com/sun/gluegen/runtime/BufferFactory.java.javase')
-rwxr-xr-x | src/java/com/sun/gluegen/runtime/BufferFactory.java.javase | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase index e7b7e52..a883316 100755 --- a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase +++ b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase @@ -56,6 +56,13 @@ public class BufferFactory { return buf; } + /** Helper routine to set a ByteBuffer to the native byte order, if + that operation is supported by the underlying NIO + implementation. */ + public static ByteBuffer nativeOrder(ByteBuffer buf) { + return buf.order(ByteOrder.nativeOrder()); + } + /** Helper routine to tell whether a buffer is direct or not. Null pointers are considered direct. isDirect() should really be public in Buffer and not replicated in all subclasses. */ |