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 longcurrentprotected Filefileprotected InputStreaminprotected longlengthprotected longmarkedprotected SharedFileInputStreamparentprotected longstart
-
Constructor Summary
Constructors Modifier Constructor Description SharedFileInputStream(File file)protectedSharedFileInputStream(SharedFileInputStream parent, long start, long len)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetPosition()SharedFileInputStreamgetRoot()voidmark(int limit)booleanmarkSupported()SharedFileInputStreamnewStream(long start, long end)intread()intread(byte[] buffer)intread(byte[] buffer, int offset, int len)voidreset()longskip(long len)protected static voidskip(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:
getPositionin interfacejavax.mail.internet.SharedInputStream
-
newStream
public SharedFileInputStream newStream(long start, long end)
- Specified by:
newStreamin interfacejavax.mail.internet.SharedInputStream
-
read
public int read(byte[] buffer) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
skip
public long skip(long len) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
mark
public void mark(int limit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
getRoot
public SharedFileInputStream getRoot()
-
-