Class RemoteFileInput
java.lang.Object
org.newsclub.net.unix.rmi.RemoteFileDescriptorBase<FileInputStream>
org.newsclub.net.unix.rmi.RemoteFileInput
- All Implemented Interfaces:
Closeable, Externalizable, Serializable, AutoCloseable, FileDescriptorAccess
public final class RemoteFileInput
extends RemoteFileDescriptorBase<FileInputStream>
implements Closeable
A specialized subclass of
RemoteFileDescriptorBase, specifically for
FileInputStreams.- Author:
- Christian Kohlschütter
- See Also:
-
Field Summary
Fields inherited from class RemoteFileDescriptorBase
resourceModifier and TypeFieldDescriptionprotected final AtomicReference<FileInputStream> An optional, closeable resource that is related to this instance. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an uninitialized instance; used for externalization.RemoteFileInput(AFUNIXRMISocketFactory socketFactory, FileInputStream fin) Creates a newRemoteFileInputinstance, encapsulating aFileInputStreamso that it can be shared with other processes via RMI. -
Method Summary
Modifier and TypeMethodDescriptionReturns a FileInputStream for the given instance.Methods inherited from class RemoteFileDescriptorBase
close, getFileDescriptor, getMagicValue, readExternal, writeExternalModifier and TypeMethodDescriptionvoidclose()final FileDescriptorReturns the file descriptor.protected final intReturns the "magic value" for this type of file descriptor.final voidreadExternal(ObjectInput objIn) final voidwriteExternal(ObjectOutput objOut)
-
Constructor Details
-
RemoteFileInput
public RemoteFileInput()Creates an uninitialized instance; used for externalization.- See Also:
-
RemoteFileInput
public RemoteFileInput(AFUNIXRMISocketFactory socketFactory, FileInputStream fin) throws IOException Creates a newRemoteFileInputinstance, encapsulating aFileInputStreamso that it can be shared with other processes via RMI.- Parameters:
socketFactory- The socket factory.fin- TheFileInputStream.- Throws:
IOException- if the operation fails.
-
-
Method Details
-
asFileInputStream
Returns a FileInputStream for the given instance. This either is the actual instance provided by the constructor or a new instance created from the file descriptor.- Returns:
- The FileInputStream.
- Throws:
IOException- if the operation fails.
-