Package org.bouncycastle.mail.smime.util
Class SharedFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.bouncycastle.mail.smime.util.SharedFileInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,javax.mail.internet.SharedInputStream
public class SharedFileInputStream extends FilterInputStream implements javax.mail.internet.SharedInputStream
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description SharedFileInputStream(File file)
SharedFileInputStream(String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Close of this stream and any substreams that have been created from it.long
getPosition()
SharedFileInputStream
getRoot()
Return the shared stream that represents the top most stream that this stream inherits from.void
mark(int readLimit)
boolean
markSupported()
InputStream
newStream(long start, long finish)
int
read()
int
read(byte[] buf)
int
read(byte[] buf, int off, int len)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.FilterInputStream
available, close
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
SharedFileInputStream
public SharedFileInputStream(String fileName) throws IOException
- Throws:
IOException
-
SharedFileInputStream
public SharedFileInputStream(File file) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getPosition
public long getPosition()
- Specified by:
getPosition
in interfacejavax.mail.internet.SharedInputStream
-
newStream
public InputStream newStream(long start, long finish)
- Specified by:
newStream
in interfacejavax.mail.internet.SharedInputStream
-
read
public int read(byte[] buf) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classFilterInputStream
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
mark
in classFilterInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
getRoot
public SharedFileInputStream getRoot()
Return the shared stream that represents the top most stream that this stream inherits from.- Returns:
- the base of the shared stream tree.
-
dispose
public void dispose() throws IOException
Close of this stream and any substreams that have been created from it.- Throws:
IOException
- on problem closing the main stream.
-
-