public class InputBuffer extends Reader implements ByteChunk.ByteInputChannel, ApplicationBufferHandler
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.
|
void |
expand(int size) |
ByteBuffer |
getByteBuffer() |
boolean |
isFinished() |
boolean |
isReady() |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(ByteBuffer to)
Transfers bytes from the buffer to the specified ByteBuffer.
|
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() |
void |
recycle()
Recycle the output buffer.
|
void |
reset() |
void |
setByteBuffer(ByteBuffer buffer) |
void |
setEncoding(String s)
Deprecated.
This method will be removed in Tomcat 9.0.x
|
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 Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
- 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.ByteInputChannel
IOException
- An underlying IOException occurredpublic int readByte() throws IOException
IOException
public int read(byte[] b, int off, int len) throws IOException
IOException
public int read(ByteBuffer to) throws IOException
to
- the ByteBuffer into which bytes are to be written.IOException
- if an input or output exception has occurred@Deprecated public void setEncoding(String s)
s
- New encoding valuepublic int realReadChars() throws IOException
IOException
public int read() throws IOException
read
in class Reader
IOException
public int read(char[] cbuf) throws IOException
read
in class Reader
IOException
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
IOException
public long skip(long n) throws IOException
skip
in class Reader
IOException
public boolean ready() throws IOException
ready
in class Reader
IOException
public boolean markSupported()
markSupported
in class Reader
public void mark(int readAheadLimit) throws IOException
mark
in class Reader
IOException
public void reset() throws IOException
reset
in class Reader
IOException
public void checkConverter() throws IOException
IOException
public void setByteBuffer(ByteBuffer buffer)
setByteBuffer
in interface ApplicationBufferHandler
public ByteBuffer getByteBuffer()
getByteBuffer
in interface ApplicationBufferHandler
public void expand(int size)
expand
in interface ApplicationBufferHandler
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.