Class RemoteFileOutput
java.lang.Object
org.newsclub.net.unix.rmi.RemoteFileDescriptorBase<FileOutputStream>
org.newsclub.net.unix.rmi.RemoteFileOutput
- All Implemented Interfaces:
Closeable, Externalizable, Serializable, AutoCloseable, FileDescriptorAccess
A specialized subclass of
RemoteFileDescriptorBase, specifically for
FileOutputStreams.- Author:
- Christian Kohlschütter
- See Also:
-
Field Summary
Fields inherited from class RemoteFileDescriptorBase
resourceModifier and TypeFieldDescriptionprotected final AtomicReference<FileOutputStream> An optional, closeable resource that is related to this instance. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an uninitialized instance; used for externalization.RemoteFileOutput(AFUNIXRMISocketFactory socketFactory, FileOutputStream fout) Creates a newRemoteFileOutputinstance, encapsulating aFileOutputStreamso that it can be shared with other processes via RMI. -
Method Summary
Modifier and TypeMethodDescriptionReturns a FileOutputStream 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
-
RemoteFileOutput
public RemoteFileOutput()Creates an uninitialized instance; used for externalization.- See Also:
-
RemoteFileOutput
public RemoteFileOutput(AFUNIXRMISocketFactory socketFactory, FileOutputStream fout) throws IOException Creates a newRemoteFileOutputinstance, encapsulating aFileOutputStreamso that it can be shared with other processes via RMI.- Parameters:
socketFactory- The socket factory.fout- TheFileOutputStream.- Throws:
IOException- if the operation fails.
-
-
Method Details
-
asFileOutputStream
Returns a FileOutputStream 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 FileOutputStream.
- Throws:
IOException- if the operation fails.
-