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:
Closeable, AutoCloseable, ByteChannel, Channel, InterruptibleChannel, ReadableByteChannel, WritableByteChannel, NativeSelectableChannel
public class NativeDeviceChannel
extends AbstractSelectableChannel
implements ByteChannel, NativeSelectableChannel
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNativeDeviceChannel(int fd) NativeDeviceChannel(int fd, boolean isFile) NativeDeviceChannel(SelectorProvider provider, int fd, int ops, boolean isFile) -
Method Summary
Modifier and TypeMethodDescriptionfinal intgetFD()protected voidprotected voidimplConfigureBlocking(boolean block) intread(ByteBuffer dst) private static SelectorProviderselectorProvider(boolean isFile) final intvalidOps()intwrite(ByteBuffer src) Methods inherited from class AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerMethods inherited from class SelectableChannel
registerMethods inherited from class AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
fd
private final int fd -
validOps
private final int validOps -
isFile
private final boolean isFile
-
-
Constructor Details
-
NativeDeviceChannel
public NativeDeviceChannel(int fd) -
NativeDeviceChannel
public NativeDeviceChannel(int fd, boolean isFile) -
NativeDeviceChannel
-
-
Method Details
-
selectorProvider
-
implCloseSelectableChannel
- Specified by:
implCloseSelectableChannelin classAbstractSelectableChannel- Throws:
IOException
-
implConfigureBlocking
- Specified by:
implConfigureBlockingin classAbstractSelectableChannel- Throws:
IOException
-
validOps
public final int validOps()- Specified by:
validOpsin classSelectableChannel
-
getFD
public final int getFD()- Specified by:
getFDin interfaceNativeSelectableChannel
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-