equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
25 package com.apple.jobjc; |
25 package com.apple.jobjc; |
26 |
26 |
27 import java.nio.ByteBuffer; |
27 import java.nio.ByteBuffer; |
28 import java.nio.ByteOrder; |
28 import java.nio.ByteOrder; |
29 |
29 |
30 import javax.tools.annotation.GenerateNativeHeader; |
|
31 |
30 |
32 /** |
31 /** |
33 * A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer |
32 * A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer |
34 */ |
33 */ |
35 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
36 @GenerateNativeHeader |
|
37 public class NativeBuffer { |
34 public class NativeBuffer { |
38 static native long getPtrOfBuffer(final ByteBuffer byteBuffer); |
35 static native long getPtrOfBuffer(final ByteBuffer byteBuffer); |
39 |
36 |
40 public final ByteBuffer buffer; |
37 public final ByteBuffer buffer; |
41 public final long bufferPtr; |
38 public final long bufferPtr; |