Package com.sun.mail.pop3
Class WritableSharedFile
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.BufferedInputStream
-
- javax.mail.util.SharedFileInputStream
-
- com.sun.mail.pop3.WritableSharedFile
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SharedInputStream
class WritableSharedFile extends SharedFileInputStream
A subclass of SharedFileInputStream that also allows writing.
-
-
Field Summary
Fields Modifier and Type Field Description private AppendStreamafprivate java.io.RandomAccessFileraf
-
Constructor Summary
Constructors Constructor Description WritableSharedFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the readable and writable files.AppendStreamgetAppendStream()Return a new AppendStream, but only if one isn't in active use.java.io.RandomAccessFilegetWritableFile()Return the writable version of this file.(package private) longupdateLength()Update the size of the readable file after writing to the file.-
Methods inherited from class javax.mail.util.SharedFileInputStream
available, finalize, getPosition, mark, markSupported, newStream, read, read, reset, skip
-
-
-
-
Field Detail
-
raf
private java.io.RandomAccessFile raf
-
af
private AppendStream af
-
-
Method Detail
-
getWritableFile
public java.io.RandomAccessFile getWritableFile()
Return the writable version of this file.
-
close
public void close() throws java.io.IOExceptionClose the readable and writable files.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classSharedFileInputStream- Throws:
java.io.IOException- if an I/O error occurs.
-
updateLength
long updateLength() throws java.io.IOExceptionUpdate the size of the readable file after writing to the file. Updates the length to be the current size of the file.- Throws:
java.io.IOException
-
getAppendStream
public AppendStream getAppendStream() throws java.io.IOException
Return a new AppendStream, but only if one isn't in active use.- Throws:
java.io.IOException
-
-