public class DumpReader extends Reader
| Constructor and Description |
|---|
DumpReader(Reader reader)
Constructor of the Dump Reader wrapping another reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the stream.
|
static int |
getMaxBufferedSize()
Return the maximum size of the buffer when reading from the main reader.
|
static int |
getTotalBuffered()
Return the total number of buffered bytes from the main reader.
|
static int |
getTotalBufferedRead()
Return the total number of bytes read from the buffer (buffered when reading from the main
reader)
|
static int |
getTotalRead()
Return the total number of read bytes from the main reader.
|
boolean |
isLastResource(int readingChildResourceIndex)
To check whether the stream is in the last child resource.
|
int |
read()
Read a single character.
|
int |
read(char[] cBuf,
int off,
int len)
Read characters into a portion of an array.
|
boolean |
ready()
Tell whether this stream is ready to be read.
|
void |
setCheckingChildByParent(boolean checkingChildByParent)
Set whether the check is done by the parent, in that case we buffer all the bytes read since
they will be re-read from the child side anyway.
|
void |
setReadingChildResourceIndex(int readingChildResourceIndex)
Set the reading child index
|
public DumpReader(Reader reader)
reader - the wrapped reader, could be file reader, http reader or another dump readerpublic int read(char[] cBuf,
int off,
int len)
throws IOException
read in class ReadercBuf - destination bufferoff - offset at which to start storing characterslen - maximum number of characters to readIOException - if an I/O error occurspublic int read()
throws IOException
read in class ReaderIOException - if an I/O error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException - if an I/O error occurspublic void setReadingChildResourceIndex(int readingChildResourceIndex)
readingChildResourceIndex - the reading child indexpublic void setCheckingChildByParent(boolean checkingChildByParent)
checkingChildByParent - true if child is checked by parent, false otherwisepublic boolean isLastResource(int readingChildResourceIndex)
throws IOException
readingChildResourceIndex - the reading child indexIOException - throws if the operation failed.public boolean ready()
throws IOException
ready in class ReaderIOException - if an I/O error occurspublic static int getTotalRead()
public static int getTotalBuffered()
public static int getMaxBufferedSize()
public static int getTotalBufferedRead()
Copyright © 2015 WSO2 Inc. All Rights Reserved.