|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
edu.emory.mathcs.util.io.FragmentInputStream
Virtual input stream that reads up to the specified number of bytes from the underlying stream and then reports EOF. Application: handle sequence of streams over a single physical "keepalive-type" stream.
Field Summary | |
static int |
ADVANCE_ON_CLOSE
Closing policy that leaves the underlying stream opened but advances it to the end of this virtual stream. |
static int |
CLOSE_ON_CLOSE
Closing policy that closes the the underlying stream. |
static int |
STAY_ON_CLOSE
Closing policy that leaves the underlying stream opened at the current position. |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
FragmentInputStream(java.io.InputStream in,
long len)
Creates new fragment input stream over a specified physical stream and with specified fragment length and STAY_ON_CLOSE closing policy. |
|
FragmentInputStream(java.io.InputStream in,
long len,
int closingPolicy)
Creates new fragment input stream over a specified physical stream and with specified fragment length and specified closing policy. |
Method Summary | |
int |
available()
|
void |
close()
|
void |
mark(int readlimit)
|
int |
read()
|
int |
read(byte[] buf,
int off,
int len)
|
void |
reset(int readlimit)
|
long |
skip(long n)
|
Methods inherited from class java.io.FilterInputStream |
markSupported, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STAY_ON_CLOSE
public static final int CLOSE_ON_CLOSE
public static final int ADVANCE_ON_CLOSE
Constructor Detail |
public FragmentInputStream(java.io.InputStream in, long len)
STAY_ON_CLOSE
closing policy.
in
- the underlying stream to read fromlen
- the total length of this fragment streampublic FragmentInputStream(java.io.InputStream in, long len, int closingPolicy)
in
- the underlying stream to read fromlen
- the total length of this fragment streamclosingPolicy
- policy that decides what to do when this stream
is closedMethod Detail |
public int read() throws java.io.IOException
java.io.IOException
public int read(byte[] buf, int off, int len) throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
java.io.IOException
public long skip(long n) throws java.io.IOException
java.io.IOException
public void mark(int readlimit)
public void reset(int readlimit) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |