public class InternalNioInputBuffer extends AbstractInternalInputBuffer
InternalNioInputBuffer
Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.
Created on Dec 14, 2011 at 9:06:18 AMModifier and Type | Class and Description |
---|---|
protected class |
InternalNioInputBuffer.InputBufferImpl
This class is an input buffer which will read its data from an input
stream.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
available
Non blocking mode.
|
protected NioChannel |
channel
Underlying channel.
|
protected NioEndpoint |
endpoint
NIO end point.
|
protected boolean |
nonBlocking
Non blocking mode.
|
activeFilters, bbuf, buf, end, filterLibrary, headers, inputBuffer, lastActiveFilter, lastValid, parsingHeader, pos, readTimeout, request, swallowInput, unit
Constructor and Description |
---|
InternalNioInputBuffer(Request request,
int headerBufferSize,
NioEndpoint endpoint)
Create a new instance of
InternalNioInputBuffer |
Modifier and Type | Method and Description |
---|---|
boolean |
available()
Available bytes in the buffer ? (these may not translate to application
readable data)
|
int |
doRead(ByteChunk chunk,
Request req)
Return from the input stream.
|
protected boolean |
fill()
Fill the internal buffer using data from the undelying input stream.
|
NioChannel |
getChannel()
Get the underlying socket input stream.
|
boolean |
getNonBlocking()
Get the non blocking flag value.
|
protected void |
init() |
boolean |
nextRequest()
End processing of current HTTP request.
|
boolean |
parseRequestLine(boolean useAvailableData)
Read the request line.
|
protected void |
readAsync() |
void |
recycle()
Recycle the input buffer.
|
void |
setChannel(NioChannel channel)
Set the underlying channel.
|
void |
setNonBlocking(boolean nonBlocking)
Set the non blocking flag.
|
void |
useAvailable()
Available bytes (note that due to encoding, this may not correspond )
|
addActiveFilter, addFilter, clearFilters, endRequest, getFilters, parseHeader, parseHeaders, parseRequestLine, removeActiveFilters, reset, setSwallowInput
protected NioChannel channel
protected boolean nonBlocking
protected boolean available
protected NioEndpoint endpoint
public InternalNioInputBuffer(Request request, int headerBufferSize, NioEndpoint endpoint)
InternalNioInputBuffer
request
- headerBufferSize
- endpoint
- protected void init()
public void setChannel(NioChannel channel)
channel
- public NioChannel getChannel()
public void setNonBlocking(boolean nonBlocking)
nonBlocking
- public boolean getNonBlocking()
public void recycle()
AbstractInternalInputBuffer
recycle
in class AbstractInternalInputBuffer
public boolean nextRequest()
AbstractInternalInputBuffer
nextRequest
in class AbstractInternalInputBuffer
public boolean parseRequestLine(boolean useAvailableData) throws IOException
useAvailableData
- IOException
- If an exception occurs during the underlying socket read
operations, or if the given buffer is not big enough to
accommodate the whole line.public void useAvailable()
public boolean available()
public int doRead(ByteChunk chunk, Request req) throws IOException
InputBuffer
IOException
protected boolean fill() throws IOException
AbstractInternalInputBuffer
fill
in class AbstractInternalInputBuffer
IOException
protected void readAsync() throws IOException
IOException
Copyright © 2015 JBoss by Red Hat. All rights reserved.