org.apache.axis.attachments
Class DimeDelimitedInputStream
java.io.FilterInputStream
org.apache.axis.attachments.DimeDelimitedInputStream
public class DimeDelimitedInputStream
extends java.io.FilterInputStream
This class takes the input stream and turns it multiple streams.
DIME version 0 format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
| VERSION |B|E|C| TYPE_T| OPT_T | OPTIONS_LENGTH | A
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ID_LENGTH | TYPE_LENGTH | Always present 12 bytes
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ even on chunked data.
| DATA_LENGTH | V
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
| /
/ OPTIONS + PADDING /
/ (absent for version 0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| /
/ ID + PADDING /
/ |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| /
/ TYPE + PADDING /
/ |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| /
/ DATA + PADDING /
/ |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This implementation of input stream does not support marking operations.
log
protected static Log log
streamCount
protected static int streamCount
streamInError
protected IOException streamInError
streamNo
protected int streamNo
_read
protected int _read(byte[] b,
int off,
int len)
throws IOException
available
public int available()
throws IOException
close
public void close()
throws IOException
Closes the stream.
This will take care of flushing any remaining data to the strea.
Multiple calls to this method will result in the stream being closed once
and then all subsequent calls being ignored.
finalClose
protected void finalClose()
throws IOException
getContentId
public String getContentId()
Get the id for this stream part.
getType
public String getType()
Get the type, as read from the header.
mark
public void mark(int readlimit)
Mark the stream.
This is not supported.
markSupported
public boolean markSupported()
newStreamNo
protected static int newStreamNo()
read
public int read()
throws IOException
Read from the boundary delimited stream.
- the byte read, or -1 if endof stream
read
public int read(byte[] b)
throws IOException
Read from the 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 IOException
Read from the DIME stream.
b
- is the array to read into.off
- is the offset
- the number of bytes read. -1 if endof stream
reset
public void reset()
throws IOException
Copyright © 2005 Apache Web Services Project. All Rights Reserved.