|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--weblogic.apache.xerces.utils.ChunkyByteArray
This class is used for accessing the data provided by an InputStream. There are two ways in which this class is used. The first occurs when we are prescanning the start of the stream to determine the encoding being used. Since we do not require that the stream be positionable, we wrap it with an instance of this class. The first "chunk" of the file is read and the data may be accessed directly using the byteAt(offset) method. After we have determined the encoding of the byte stream, the instance of this class is passed on to the EntityReader that will process the data for the scanner. At this point, the reader may continue to access this instance using the byteAt method, which will continue to read the contents into chunks as required until end of input. An example of this is the UCSReader. Alternatively, the reader may access this instance as an InputStream which will first return any data that has been reading into the chunks, and will then return the remaining data from the original InputStream directly.
Constructor Summary | |
ChunkyByteArray(java.io.InputStream is)
Constructor Reads the first chunk. |
Method Summary | |
boolean |
atEOF(int offset)
Test to see if an offset is at the end of the input data. |
byte |
byteAt(int offset)
Return a byte of input data at the given offset. |
void |
close()
Closes this input Stream |
int |
read()
Read a byte. |
int |
read(byte[] buffer,
int offset,
int length)
Read bytes. |
void |
rewind()
Reset position within the data stream back to the very beginning. |
Methods inherited from class java.io.InputStream |
available,
mark,
markSupported,
read,
reset,
skip |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ChunkyByteArray(java.io.InputStream is) throws java.io.IOException
is
- The input stream containing the data of the entity.Method Detail |
public int read() throws java.io.IOException
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- The destination for the bytes returned. If null, then
the data will discarded instead of returned.offset
- The offset within the buffer where the first returned
byte should be placed.length
- The maximum number of bytes to place in the buffer or discard.public void rewind()
public byte byteAt(int offset) throws java.io.IOException
offset
- The offset in the data stream.public boolean atEOF(int offset)
offset
- A position in the data stream.true
if the position is at the end of the data stream;
false
otherwise.public void close() throws java.io.IOException
|
Documentation is available at http://e-docs.bea.com/wls/docs61 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |