| java.lang.Object org.apache.harmony.nio.AddressUtil
AddressUtil | public class AddressUtil (Code) | | |
Method Summary | |
public static long | getChannelAddress(Channel channel) Gets the address of native resource held by the given channel, if it has
any. | public static long | getDirectBufferAddress(Buffer buf) Gets the start address of a direct buffer.
This method corresponds to the JNI function:
void* GetDirectBufferAddress(JNIEnv* env, jobject buf);
Parameters: buf - the direct buffer whose address shall be returned must not benull . |
getChannelAddress | public static long getChannelAddress(Channel channel)(Code) | | Gets the address of native resource held by the given channel, if it has
any.
For network related channel, including
SocketChannel ,
ServerSocketChannel and
DatagramChannel , this method
returns the Socket handle (long) in Linux, and returns a SOCKET
(UINT_PTR) in windows.
For
FileChannel , this method returns the native file descriptor.
For other channels, this method return 0, which means unsupported
operation.
Parameters: channel - the given channel which may holds a native resource address the address of native resource held by the given channel, if any,otherwise return 0 |
getDirectBufferAddress | public static long getDirectBufferAddress(Buffer buf)(Code) | | Gets the start address of a direct buffer.
This method corresponds to the JNI function:
void* GetDirectBufferAddress(JNIEnv* env, jobject buf);
Parameters: buf - the direct buffer whose address shall be returned must not benull . the address of the buffer given, or zero if the buffer is not adirect Buffer. |
|
|