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 AppendStream
af
private java.io.RandomAccessFile
raf
-
Constructor Summary
Constructors Constructor Description WritableSharedFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the readable and writable files.AppendStream
getAppendStream()
Return a new AppendStream, but only if one isn't in active use.java.io.RandomAccessFile
getWritableFile()
Return the writable version of this file.(package private) long
updateLength()
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.IOException
Close the readable and writable files.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classSharedFileInputStream
- Throws:
java.io.IOException
- if an I/O error occurs.
-
updateLength
long updateLength() throws java.io.IOException
Update 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
-
-