org.apache.axis.attachments
Class BoundaryDelimitedStream
java.io.FilterInputStream
org.apache.axis.attachments.BoundaryDelimitedStream
public class BoundaryDelimitedStream
extends java.io.FilterInputStream
This class takes the input stream and turns it multiple streams.
protected static int | BOUNDARY_NOT_FOUND - Field BOUNDARY_NOT_FOUND.
|
protected byte[] | boundary
|
protected static Log | log - The
Log that this class should log all events to.
|
protected int | streamNo - Field streamNo.
|
int | available()
|
protected int | boundaryPosition(byte[] searchbuf, int start, int end) - Read from the boundary delimited stream.
|
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.
|
void | reset() - reset the stream.
|
BOUNDARY_NOT_FOUND
protected static final int BOUNDARY_NOT_FOUND
Field BOUNDARY_NOT_FOUND.
boundary
protected byte[] boundary
log
protected static Log log
The Log
that this class should log all events to.
streamNo
protected int streamNo
Field streamNo.
BoundaryDelimitedStream
protected BoundaryDelimitedStream(BoundaryDelimitedStream prev,
int readbufsz)
throws java.io.IOException
Constructor to create the next stream from the previous one.
prev
- the previous streamreadbufsz
- how many bytes to make the read buffer
available
public int available()
throws java.io.IOException
boundaryPosition
protected int boundaryPosition(byte[] searchbuf,
int start,
int end)
throws java.io.IOException
Read from the boundary delimited stream.
searchbuf
- buffer to read fromstart
- starting indexend
- ending index
- The position of the boundary. Detects the end of the source stream.
close
public void close()
throws java.io.IOException
Closes the stream.
finalClose
protected void finalClose()
throws java.io.IOException
Close the underlying stream and remove all references to it.
getNextStream
public BoundaryDelimitedStream getNextStream()
throws java.io.IOException
Gets the next stream. From the previous using the same buffer size to
read.
- the boundary delmited stream, null if there are no more streams.
getNextStream
protected BoundaryDelimitedStream getNextStream(int readbufsz)
throws java.io.IOException
Gets the next stream. From the previous using new buffer reading size.
- the boundary delmited stream, null if there are no more streams.
mark
public void mark(int readlimit)
mark the stream.
This is not supported.
markSupported
public boolean markSupported()
markSupported
return false;
newStreamNo
protected static int newStreamNo()
Signal that a new stream has been created.
printarry
public static void printarry(byte[] b,
int start,
int end)
Method printarry
read
public int read()
throws java.io.IOException
Read from the boundary delimited stream.
- The byte read, or -1 if endof stream.
read
public int read(byte[] b)
throws java.io.IOException
Read from the boundary delimited stream.
b
- is the array to read into. Read as much as possible
into the size of this array.
- the number of bytes read. -1 if endof stream.
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
Read from the boundary delimited stream.
b
- is the array to read into.off
- is the offsetlen
-
- the number of bytes read. -1 if endof stream.
reset
public void reset()
throws java.io.IOException
reset the stream.
This is not supported.
Copyright © 2005 Apache Web Services Project. All Rights Reserved.