Package jnr.enxio.channels
Class NativeDeviceChannel
- java.lang.Object
-
- java.nio.channels.spi.AbstractInterruptibleChannel
-
- java.nio.channels.SelectableChannel
-
- java.nio.channels.spi.AbstractSelectableChannel
-
- jnr.enxio.channels.NativeDeviceChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.InterruptibleChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.WritableByteChannel,NativeSelectableChannel
public class NativeDeviceChannel extends java.nio.channels.spi.AbstractSelectableChannel implements java.nio.channels.ByteChannel, NativeSelectableChannel
-
-
Constructor Summary
Constructors Constructor Description NativeDeviceChannel(int fd)NativeDeviceChannel(int fd, boolean isFile)NativeDeviceChannel(java.nio.channels.spi.SelectorProvider provider, int fd, int ops, boolean isFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFD()protected voidimplCloseSelectableChannel()protected voidimplConfigureBlocking(boolean block)intread(java.nio.ByteBuffer dst)private static java.nio.channels.spi.SelectorProviderselectorProvider(boolean isFile)intvalidOps()intwrite(java.nio.ByteBuffer src)-
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
-
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
-
-
-
Method Detail
-
selectorProvider
private static java.nio.channels.spi.SelectorProvider selectorProvider(boolean isFile)
-
implCloseSelectableChannel
protected void implCloseSelectableChannel() throws java.io.IOException- Specified by:
implCloseSelectableChannelin classjava.nio.channels.spi.AbstractSelectableChannel- Throws:
java.io.IOException
-
implConfigureBlocking
protected void implConfigureBlocking(boolean block) throws java.io.IOException- Specified by:
implConfigureBlockingin classjava.nio.channels.spi.AbstractSelectableChannel- Throws:
java.io.IOException
-
validOps
public final int validOps()
- Specified by:
validOpsin classjava.nio.channels.SelectableChannel
-
getFD
public final int getFD()
- Specified by:
getFDin interfaceNativeSelectableChannel
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
-