diff options
Diffstat (limited to 'src/java/com/sun/gluegen/runtime')
-rwxr-xr-x | src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp | 7 | ||||
-rwxr-xr-x | src/java/com/sun/gluegen/runtime/BufferFactory.java.javase | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp index 16c1494..622cc37 100755 --- a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp +++ b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp @@ -52,6 +52,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; + } + /** 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. */ 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. */ |