Class SharedFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.nuxeo.ecm.automation.jaxrs.io.SharedFileInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,javax.mail.internet.SharedInputStream
public class SharedFileInputStream extends InputStream implements javax.mail.internet.SharedInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected long
current
protected File
file
protected InputStream
in
protected long
length
protected long
marked
protected SharedFileInputStream
parent
protected long
start
-
Constructor Summary
Constructors Modifier Constructor Description SharedFileInputStream(File file)
protected
SharedFileInputStream(SharedFileInputStream parent, long start, long len)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getPosition()
SharedFileInputStream
getRoot()
void
mark(int limit)
boolean
markSupported()
SharedFileInputStream
newStream(long start, long end)
int
read()
int
read(byte[] buffer)
int
read(byte[] buffer, int offset, int len)
void
reset()
long
skip(long len)
protected static void
skip(InputStream in, long n)
Skip reliably; this is more efficient than IOUtils.skip which calls read().-
Methods inherited from class java.io.InputStream
available, close, nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Field Detail
-
in
protected final InputStream in
-
parent
protected final SharedFileInputStream parent
-
file
protected final File file
-
length
protected final long length
-
start
protected final long start
-
current
protected long current
-
marked
protected long marked
-
-
Constructor Detail
-
SharedFileInputStream
public SharedFileInputStream(File file) throws IOException
- Throws:
IOException
-
SharedFileInputStream
protected SharedFileInputStream(SharedFileInputStream parent, long start, long len) throws IOException
- Throws:
IOException
-
-
Method Detail
-
skip
protected static void skip(InputStream in, long n) throws IOException
Skip reliably; this is more efficient than IOUtils.skip which calls read().- Throws:
IOException
-
getPosition
public long getPosition()
- Specified by:
getPosition
in interfacejavax.mail.internet.SharedInputStream
-
newStream
public SharedFileInputStream newStream(long start, long end)
- Specified by:
newStream
in interfacejavax.mail.internet.SharedInputStream
-
read
public int read(byte[] buffer) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
skip
public long skip(long len) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
mark
public void mark(int limit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
getRoot
public SharedFileInputStream getRoot()
-
-