Top Description Fields Constructors Methods
org.jruby.util.io

public Class ChannelFD

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
jnr.constants.platform.Errno, jnr.enxio.channels.NativeDeviceChannel, .NativeSelectableChannel, jnr.posix.FileStat, .POSIX, org.jruby.RubySystemCallError, org.jruby.exceptions.SystemCallError, org.jruby.platform.Platform, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, java.io.Closeable, .IOException, java.nio.channels.Channel, .ClosedChannelException, .FileChannel, .FileLock, .ReadableByteChannel, .SeekableByteChannel, .SelectableChannel, .SocketChannel, .WritableByteChannel, java.util.concurrent.atomic.AtomicInteger

Created by headius on 5/24/14.

Field Summary

Modifier and TypeField and Description
public Channel
public FileChannel
public NativeSelectableChannel
public ReadableByteChannel
public SeekableByteChannel
public SelectableChannel
public SocketChannel
public WritableByteChannel
public ThreadLocal<FileLock>
public int
private final FilenoUtil
public boolean
private boolean
private boolean
private final int
private final POSIX
public int
private AtomicInteger

Constructor Summary

AccessConstructor and Description
public
ChannelFD(Channel fd, POSIX posix, FilenoUtil filenoUtil, int flags)

public
ChannelFD(Channel fd, POSIX posix, FilenoUtil filenoUtil)

Method Summary

Modifier and TypeMethod and Description
public int
public int
bestFileno(boolean forceFileno)

public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public ChannelFD
dup()

public int
dup2From(POSIX posix, ChannelFD dup2Source)

private void
private void
private void
initFileno(boolean allocate)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chback to summary
public Channel ch
chFileback to summary
public FileChannel chFile
chNativeback to summary
public NativeSelectableChannel chNative
chReadback to summary
public ReadableByteChannel chRead
chSeekback to summary
public SeekableByteChannel chSeek
chSelectback to summary
public SelectableChannel chSelect
chSockback to summary
public SocketChannel chSock
chWriteback to summary
public WritableByteChannel chWrite
currentLockback to summary
public ThreadLocal<FileLock> currentLock
fakeFilenoback to summary
public int fakeFileno
filenoUtilback to summary
private final FilenoUtil filenoUtil
isNativeFileback to summary
public boolean isNativeFile
maybeHandleback to summary
private boolean maybeHandle
needsClosingback to summary
private boolean needsClosing
openflagsback to summary
private final int openflags
posixback to summary
private final POSIX posix
realFilenoback to summary
public int realFileno
refsback to summary
private AtomicInteger refs

Constructor Detail

ChannelFDback to summary
public ChannelFD(Channel fd, POSIX posix, FilenoUtil filenoUtil, int flags)
ChannelFDback to summary
public ChannelFD(Channel fd, POSIX posix, FilenoUtil filenoUtil)

Method Detail

bestFilenoback to summary
public int bestFileno()
bestFilenoback to summary
public int bestFileno(boolean forceFileno)
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Exceptions
IOException:
if an I/O error occurs
dupback to summary
public ChannelFD dup()
dup2Fromback to summary
public int dup2From(POSIX posix, ChannelFD dup2Source)
finishback to summary
private void finish() throws IOException
initChannelTypesback to summary
private void initChannelTypes()
initFilenoback to summary
private void initFileno(boolean allocate)