Package org.apache.axiom.attachments
Class BoundaryPushbackInputStream
java.lang.Object
java.io.InputStream
org.apache.axiom.attachments.BoundaryPushbackInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream that reads bytes up to a boundary.
The boundary is not logically part of the bytes to read.
The wrapped PushbackInputStream is set to to the byte after
the boundary once the bytes are read.
The boundary is not logically returned.
There are two forms that are supported, where . is a byte
.......................boundary
and
..................../r/nboundary
In both cases, only the bytes (.) are returned.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoundaryPushbackInputStream(PushbackInputStream inStream, byte[] boundary, int pushBackSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected intboundaryPosition(byte[] searchbuf, int start, int end) Read from the boundary delimited stream.booleanintread()Read from the boundary delimited stream.intread(byte[] b) intread(byte[] b, int off, int len) Read from the boundary delimited stream.toString()toString dumps state information.Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
BOUNDARY_NT_FOUND
protected static final int BOUNDARY_NT_FOUND- See Also:
-
-
Constructor Details
-
BoundaryPushbackInputStream
- Parameters:
inStream-boundary-pushBackSize-
-
-
Method Details
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
Read from the boundary delimited stream. Generally, this won't be called...callers will most likely call the read(byte[]..) methods- Specified by:
readin classInputStream- Returns:
- The byte read, or -1 if endof stream.
- Throws:
IOException
-
read
Read from the boundary delimited stream.- Overrides:
readin classInputStream- Parameters:
b- is the array to read into.off- is the offsetlen-- Returns:
- the number of bytes read. -1 if endof stream.
- Throws:
IOException
-
boundaryPosition
Read from the boundary delimited stream.- Parameters:
searchbuf-start-end-- Returns:
- The position of the boundary.
- Throws:
IOException
-
getBoundaryStatus
public boolean getBoundaryStatus() -
toString
toString dumps state information. Effective for debug trace.
-