public class DimeDelimitedInputStream extends FilterInputStream
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.
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
protected static int |
streamCount |
protected IOException |
streamInError |
protected int |
streamNo |
in| Modifier and Type | Method and Description |
|---|---|
protected int |
_read(byte[] b,
int off,
int len) |
int |
available() |
void |
close()
Closes the stream.
|
protected void |
finalClose() |
String |
getContentId()
Get the id for this stream part.
|
DimeTypeNameFormat |
getDimeTypeNameFormat() |
String |
getType()
Get the type, as read from the header.
|
void |
mark(int readlimit)
Mark the stream.
|
boolean |
markSupported() |
protected static int |
newStreamNo() |
int |
read()
Read from the boundary delimited stream.
|
int |
read(byte[] b)
Read from the delimited stream.
|
int |
read(byte[] b,
int off,
int len)
Read from the DIME stream.
|
void |
reset() |
skipprotected static org.apache.commons.logging.Log log
protected int streamNo
protected IOException streamInError
protected static int streamCount
protected static int newStreamNo()
public String getContentId()
public DimeTypeNameFormat getDimeTypeNameFormat()
public String getType()
public int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamb - is the array to read into.off - is the offsetIOException - if data could not be read from the streamprotected int _read(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic int read(byte[] b)
throws IOException
read in class FilterInputStreamb - is the array to read into. Read as much as possible
into the size of this array.IOException - if data could not be read from the streampublic int read()
throws IOException
read in class FilterInputStreamIOException - if there was an error reading the datapublic void close()
throws IOException
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.
close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOException - if the stream could not be closedpublic void mark(int readlimit)
mark in class FilterInputStreampublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported in class FilterInputStreampublic int available()
throws IOException
available in class FilterInputStreamIOExceptionprotected void finalClose()
throws IOException
IOExceptionCopyright © The Apache Software Foundation. All Rights Reserved.