Top Description Fields Constructors Methods
org.newsclub.net.unix

pack-priv final Class RAFChannelProvider

extends RandomAccessFile
implements FileDescriptorAccess
Class Inheritance
All Implemented Interfaces
org.newsclub.net.unix.FileDescriptorAccess
Imports
java.io.File, .FileDescriptor, .IOException, .RandomAccessFile, java.nio.channels.FileChannel, java.util.UUID, java.util.concurrent.atomic.AtomicBoolean

Hack to get a readable AND writable FileChannel for a FileDescriptor.
Author
Christian Kohlschütter

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final FileDescriptor
private final FileDescriptor
private final File

Constructor Summary

AccessConstructor and Description
private
private

Method Summary

Modifier and TypeMethod and Description
public synchronized void
close()

Overrides java.io.RandomAccessFile.close.

Implements java.io.Closeable.close.

Closes this random access file stream and releases any system resources associated with the stream.

public static FileChannel
private static FileChannel
public FileDescriptor
Inherited from java.io.RandomAccessFile:
getChannelgetFDgetFilePointerlengthreadreadreadreadBooleanreadBytereadCharreadDoublereadFloatreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedShortreadUTFseeksetLengthskipByteswritewritewritewriteBooleanwriteBytewriteByteswriteCharwriteCharswriteDoublewriteFloatwriteIntwriteLongwriteShortwriteUTF

Field Detail

closedback to summary
private final AtomicBoolean closed

Hides java.io.RandomAccessFile.closed.

fdObjback to summary
private final FileDescriptor fdObj
rafFdOrigback to summary
private final FileDescriptor rafFdOrig
tempPathback to summary
private final File tempPath

Constructor Detail

RAFChannelProviderback to summary
private RAFChannelProvider(FileDescriptor fdObj) throws IOException
RAFChannelProviderback to summary
private RAFChannelProvider(FileDescriptor fdObj, File tempPath) throws IOException

Method Detail

closeback to summary
public synchronized void close() throws IOException

Overrides java.io.RandomAccessFile.close.

Implements java.io.Closeable.close.

Doc from java.io.RandomAccessFile.close.

Closes this random access file stream and releases any system resources associated with the stream. A closed random access file cannot perform input or output operations and cannot be reopened.

If this file has an associated channel then the channel is closed as well.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getFileChannelback to summary
public static FileChannel getFileChannel(FileDescriptor fd) throws IOException
getFileChannel0back to summary
private static FileChannel getFileChannel0(FileDescriptor fd) throws IOException
Annotations
@SuppressWarnings:resource
getFileDescriptorback to summary
public FileDescriptor getFileDescriptor()

Implements org.newsclub.net.unix.FileDescriptorAccess.getFileDescriptor.

Doc from org.newsclub.net.unix.FileDescriptorAccess.getFileDescriptor.

Returns the corresponding FileDescriptor.

Returns:FileDescriptor

The corresponding FileDescriptor.

Annotations
@Override