public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, CharChunk.CharInputChannel, CharChunk.CharOutputChannel
| Modifier and Type | Field and Description |
|---|---|
int |
BYTE_STATE |
int |
CHAR_STATE |
protected B2CConverter |
conv
Current byte to char converter.
|
static int |
DEFAULT_BUFFER_SIZE |
int |
INITIAL_STATE |
protected static StringManager |
sm
The string manager for this package.
|
| Constructor and Description |
|---|
InputBuffer()
Default constructor.
|
InputBuffer(int size)
Alternate constructor which allows specifying the initial buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
checkConverter() |
void |
close()
Close the input buffer.
|
boolean |
isFinished() |
boolean |
isReady() |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(char[] cbuf) |
int |
read(char[] cbuf,
int off,
int len) |
int |
readByte() |
boolean |
ready() |
int |
realReadBytes()
Reads new bytes in the byte chunk.
|
int |
realReadChars()
Read new characters.
|
void |
realWriteChars(char[] c,
int off,
int len)
Since the converter will use append, it is possible to get chars to
be removed from the buffer for "writing".
|
void |
recycle()
Recycle the output buffer.
|
void |
reset() |
void |
setEncoding(String s) |
void |
setReadListener(ReadListener listener) |
void |
setRequest(Request coyoteRequest)
Associated Coyote request.
|
long |
skip(long n) |
protected static final StringManager sm
public static final int DEFAULT_BUFFER_SIZE
public final int INITIAL_STATE
public final int CHAR_STATE
public final int BYTE_STATE
protected B2CConverter conv
public InputBuffer()
public InputBuffer(int size)
size - Buffer size to usepublic void setRequest(Request coyoteRequest)
coyoteRequest - Associated Coyote requestpublic void recycle()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException - An underlying IOException occurredpublic int available()
public void setReadListener(ReadListener listener)
public boolean isFinished()
public boolean isReady()
public int realReadBytes()
throws IOException
realReadBytes in interface ByteChunk.ByteInputChannelIOException - An underlying IOException occurredpublic int readByte()
throws IOException
IOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void realWriteChars(char[] c,
int off,
int len)
throws IOException
realWriteChars in interface CharChunk.CharOutputChannelc - characters that will be writtenoff - offset in the characters arraylen - length that will be writtenIOException - If an I/O occurs while writing the characterspublic void setEncoding(String s)
public int realReadChars()
throws IOException
CharChunk.CharInputChannelrealReadChars in interface CharChunk.CharInputChannelIOException - If an I/O error occurs reading the characterspublic int read()
throws IOException
read in class ReaderIOExceptionpublic int read(char[] cbuf)
throws IOException
read in class ReaderIOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws IOException
read in class ReaderIOExceptionpublic long skip(long n)
throws IOException
skip in class ReaderIOExceptionpublic boolean ready()
throws IOException
ready in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Readerpublic void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic void reset()
throws IOException
reset in class ReaderIOExceptionpublic void checkConverter()
throws IOException
IOExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.