public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, CharChunk.CharInputChannel
| 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 |
static String |
DEFAULT_ENCODING |
protected HashMap<String,B2CConverter> |
encoders
List of encoders.
|
int |
INITIAL_STATE |
| Constructor and Description |
|---|
InputBuffer(Request request)
Default constructor.
|
InputBuffer(Request request,
int size)
Alternate constructor which allows specifying the initial buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
checkConverter() |
void |
clearEncoders()
Clear cached encoders (to save memory for event requests).
|
void |
close()
Close the input buffer.
|
int |
getAvailable() |
javax.servlet.ReadListener |
getReadListener() |
Request |
getRequest()
Get associated Coyote request.
|
boolean |
isClosed()
Returns if the request is closed.
|
boolean |
isEof()
Returns if the eof has been reached.
|
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(byte[] cbuf,
int off,
int len)
Reads new bytes in the byte chunk.
|
int |
realReadChars(char[] cbuf,
int off,
int len)
Read new bytes ( usually the internal conversion buffer ).
|
void |
recycle()
Recycle the output buffer.
|
void |
reset() |
protected void |
setConverter() |
void |
setEncoding(String s) |
void |
setReadListener(javax.servlet.ReadListener readListener) |
void |
setRequest(Request coyoteRequest)
Associated Coyote request.
|
long |
skip(long n) |
public static final String DEFAULT_ENCODING
public static final int DEFAULT_BUFFER_SIZE
public final int INITIAL_STATE
public final int CHAR_STATE
public final int BYTE_STATE
protected HashMap<String,B2CConverter> encoders
protected B2CConverter conv
public InputBuffer(Request request)
public InputBuffer(Request request, int size)
size - Buffer size to usepublic void setRequest(Request coyoteRequest)
coyoteRequest - Associated Coyote requestpublic Request getRequest()
public void recycle()
public void clearEncoders()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException - An underlying IOException occurredpublic boolean isClosed()
public boolean isEof()
public int available()
public int getAvailable()
public int realReadBytes(byte[] cbuf,
int off,
int len)
throws IOException
realReadBytes in interface ByteChunk.ByteInputChannelcbuf - Byte buffer to be written to the responseoff - Offsetlen - LengthIOException - An underlying IOException occurredpublic int readByte()
throws IOException
IOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void setEncoding(String s)
public int realReadChars(char[] cbuf,
int off,
int len)
throws IOException
CharChunk.CharInputChannelrealReadChars in interface CharChunk.CharInputChannelIOExceptionpublic 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
IOExceptionprotected void setConverter()
throws IOException
IOExceptionpublic javax.servlet.ReadListener getReadListener()
public void setReadListener(javax.servlet.ReadListener readListener)
Copyright © 2016 JBoss by Red Hat. All rights reserved.