|
||||||||||
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.apache.axiom.attachments.BoundaryDelimitedStream
public class BoundaryDelimitedStream
This class takes the input stream and turns it multiple streams.
Field Summary | |
---|---|
protected byte[] |
boundary
|
protected static int |
BOUNDARY_NOT_FOUND
Field BOUNDARY_NOT_FOUND. |
(package private) int |
boundaryBufLen
The boundary length plus crlf. |
(package private) int |
boundaryLen
The boundary length. |
(package private) int |
boundaryPos
Field boundaryPos. |
(package private) boolean |
closed
The stream has been closed. |
(package private) boolean |
eos
eof has been detected. |
(package private) java.io.InputStream |
is
The source input stream. |
(package private) static boolean |
isDebugEnabled
Field isDebugEnabled. |
protected static org.apache.commons.logging.Log |
log
The Log that this class should log all events to. |
(package private) byte[] |
readbuf
The buffer we are reading. |
(package private) int |
readBufEnd
The number of bytes in array. |
(package private) int |
readBufPos
Where we have read so far in the stream. |
(package private) int |
readbufsz
Minimum to read at one time. |
private int[] |
skip
|
(package private) static int |
streamCount
The number of streams produced. |
protected int |
streamNo
Field streamNo. |
(package private) boolean |
theEnd
There are no more streams left. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
protected |
BoundaryDelimitedStream(BoundaryDelimitedStream prev,
int readbufsz)
Constructor to create the next stream from the previous one. |
(package private) |
BoundaryDelimitedStream(java.io.InputStream is,
byte[] boundary,
int readbufsz)
Create a new boundary stream. |
Method Summary | |
---|---|
int |
available()
|
protected int |
boundaryPosition(byte[] searchbuf,
int start,
int end)
Read from the boundary delimited stream. |
private int |
boundarySearch(byte[] text,
int start,
int end)
|
void |
close()
Closes the stream. |
protected void |
finalClose()
Close the underlying stream and remove all references to it. |
BoundaryDelimitedStream |
getNextStream()
Gets the next stream. |
protected BoundaryDelimitedStream |
getNextStream(int readbufsz)
Gets the next stream. |
void |
mark(int readlimit)
mark the stream. |
boolean |
markSupported()
markSupported return false; |
protected static int |
newStreamNo()
Signal that a new stream has been created. |
static void |
printarry(byte[] b,
int start,
int end)
Method printarry |
int |
read()
Read from the boundary delimited stream. |
int |
read(byte[] b)
Read from the boundary delimited stream. |
int |
read(byte[] b,
int off,
int len)
Read from the boundary delimited stream. |
private int |
readFromStream(byte[] b)
|
private int |
readFromStream(byte[] b,
int start,
int length)
|
void |
reset()
reset the stream. |
Methods inherited from class java.io.FilterInputStream |
---|
skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
Log
that this class should log all events to.
protected byte[] boundary
int boundaryLen
int boundaryBufLen
java.io.InputStream is
boolean closed
boolean eos
boolean theEnd
int readbufsz
byte[] readbuf
int readBufPos
int readBufEnd
protected static final int BOUNDARY_NOT_FOUND
int boundaryPos
static int streamCount
protected int streamNo
static boolean isDebugEnabled
private int[] skip
Constructor Detail |
---|
protected BoundaryDelimitedStream(BoundaryDelimitedStream prev, int readbufsz) throws java.io.IOException
prev
- the previous streamreadbufsz
- how many bytes to make the read buffer
java.io.IOException
- if there was a problem reading data from prev
BoundaryDelimitedStream(java.io.InputStream is, byte[] boundary, int readbufsz) throws OMException
is
- boundary
- is the boundary that separates the individual streams.readbufsz
- lets you have some control over the amount of buffering. by buffering you
can some effiency in searching.
OMException
Method Detail |
---|
protected static int newStreamNo()
public BoundaryDelimitedStream getNextStream() throws java.io.IOException
java.io.IOException
- if there was an error loading the data for the next streamprotected BoundaryDelimitedStream getNextStream(int readbufsz) throws java.io.IOException
readbufsz
-
java.io.IOException
- if there was an error loading the data for the next streamprivate int readFromStream(byte[] b) throws java.io.IOException
java.io.IOException
private int readFromStream(byte[] b, int start, int length) throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
b
- is the array to read into.off
- is the offsetlen
-
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
b
- is the array to read into. Read as much as possible into the size of this array.
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.FilterInputStream
readlimit
- public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.FilterInputStream
public int available() throws java.io.IOException
available
in class java.io.FilterInputStream
java.io.IOException
protected int boundaryPosition(byte[] searchbuf, int start, int end) throws java.io.IOException
searchbuf
- buffer to read fromstart
- starting indexend
- ending index
java.io.IOException
- if there was an error manipulating the underlying streamprivate int boundarySearch(byte[] text, int start, int end)
protected void finalClose() throws java.io.IOException
java.io.IOException
- if the stream could not be closedpublic static void printarry(byte[] b, int start, int end)
b
- start
- end
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |