|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.jboss.gravel.data.phase.BoundaryDelimitedInputStream
public class BoundaryDelimitedInputStream
BoundaryDelimitedInputStream
encapsulates a stream that is
sepearated into different sections by a common boundary, such as a MIME
multipart message. The full stream is referred to as the outer stream. Each
boundary separated section in the outer stream is referred to as an inner
stream.
All read() methods will start from the first inner stream, returning -1 when
a boundary is reached. Subsequent calls will then advance to the next stream,
skipping the boundary.
Constructor Summary | |
---|---|
BoundaryDelimitedInputStream(InputStream in,
byte[] boundary)
Constructs a BoundaryDelimitedInputStream using the passed
InputStream as the source for the outer stream. |
Method Summary | |
---|---|
int |
available()
This method will always return 0 because this input stream must always read ahead to determine the location of the boundary. |
void |
close()
Close this input stream, and its source input stream. |
boolean |
isOuterStreamClosed()
Returns whether the outer stream is closed. |
boolean |
markSupported()
Returns false. |
void |
printLeftOvers()
|
int |
read()
Reads a single byte from the inner input stream. |
int |
read(byte[] b)
Reads from the inner input stream, attempting to fill the passed byte array. |
int |
read(byte[] b,
int off,
int len)
Reads the specified number of bytes starting from the specified offset into the specified buffer from the inner input stream. |
long |
skip(long n)
Skips the specified number of bytes from the inner input stream. |
Methods inherited from class java.io.FilterInputStream |
---|
mark, reset |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoundaryDelimitedInputStream(InputStream in, byte[] boundary)
BoundaryDelimitedInputStream
using the passed
InputStream
as the source for the outer stream.
in
- the source input streamboundary
- the byte boundary separating sections of this streamMethod Detail |
---|
public int available() throws IOException
available
in class FilterInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
public boolean markSupported()
markSupported
in class FilterInputStream
public int read() throws IOException
InputStream
.
read
in class FilterInputStream
IOException
public int read(byte[] b) throws IOException
InputStream
.
read
in class FilterInputStream
b
- the byte array to populate
b
, -1 on EOF
IOException
public long skip(long n) throws IOException
InputStream
.
skip
in class FilterInputStream
n
- the number of bytes to skip
IOException
public int read(byte[] b, int off, int len) throws IOException
InputStream
.
read
in class FilterInputStream
b
- the byte array to populateoff
- the offset in the array to start atlen
- the number of bytes to read, -1 on EOF
IOException
public boolean isOuterStreamClosed()
public void printLeftOvers()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |