org.glassfish.grizzly.http.util
Class BufferChunk
java.lang.Object
org.glassfish.grizzly.http.util.BufferChunk
- All Implemented Interfaces:
- Chunk
public class BufferChunk
- extends Object
- implements Chunk
Buffer chunk representation.
Helps HTTP module to avoid redundant String creation.
- Author:
- Alexey Stashok
|
Method Summary |
int |
compare(int start,
int end,
String compareTo)
|
int |
compareIgnoreCase(int start,
int end,
String compareTo)
|
void |
delete(int start,
int end)
|
boolean |
equals(CharSequence s)
|
boolean |
equalsIgnoreCase(CharSequence s)
|
int |
findBytesAscii(byte[] b)
Returns the starting index of the specified byte sequence within this
Buffer. |
Buffer |
getBuffer()
|
int |
getEnd()
|
int |
getLength()
|
int |
getStart()
|
int |
indexOf(char c,
int fromIndex)
|
int |
indexOf(String s,
int fromIndex)
|
boolean |
isNull()
|
void |
recycle()
|
protected void |
reset()
|
protected void |
resetStringCache()
|
void |
setBuffer(Buffer buffer)
|
void |
setBufferChunk(Buffer buffer,
int start,
int end)
|
void |
setEnd(int end)
|
void |
setStart(int start)
|
boolean |
startsWithIgnoreCase(String s,
int pos)
|
CharChunk |
toChars(CharChunk cc,
Charset encoding)
Convert a BufferChunk using the specified encoding. |
String |
toString()
|
String |
toString(Charset charset)
|
String |
toString(int start,
int end)
|
BufferChunk
public BufferChunk()
setBufferChunk
public void setBufferChunk(Buffer buffer,
int start,
int end)
getBuffer
public Buffer getBuffer()
setBuffer
public void setBuffer(Buffer buffer)
getStart
public int getStart()
- Specified by:
getStart in interface Chunk
setStart
public void setStart(int start)
- Specified by:
setStart in interface Chunk
getEnd
public int getEnd()
- Specified by:
getEnd in interface Chunk
setEnd
public void setEnd(int end)
- Specified by:
setEnd in interface Chunk
getLength
public final int getLength()
isNull
public boolean isNull()
delete
public void delete(int start,
int end)
- Specified by:
delete in interface Chunk
indexOf
public final int indexOf(char c,
int fromIndex)
- Specified by:
indexOf in interface Chunk
indexOf
public final int indexOf(String s,
int fromIndex)
- Specified by:
indexOf in interface Chunk
startsWithIgnoreCase
public boolean startsWithIgnoreCase(String s,
int pos)
findBytesAscii
public int findBytesAscii(byte[] b)
- Returns the starting index of the specified byte sequence within this
Buffer.
- Parameters:
b - byte sequence to search for.
- Returns:
- the starting index of the specified byte sequence within this
Buffer
equals
public boolean equals(CharSequence s)
equalsIgnoreCase
public boolean equalsIgnoreCase(CharSequence s)
toString
public String toString()
- Overrides:
toString in class Object
toString
public String toString(Charset charset)
toString
public String toString(int start,
int end)
- Specified by:
toString in interface Chunk
resetStringCache
protected final void resetStringCache()
reset
protected final void reset()
recycle
public final void recycle()
compareIgnoreCase
public int compareIgnoreCase(int start,
int end,
String compareTo)
- Returns:
- -1, 0 or +1 if inferior, equal, or superior to the String.
compare
public int compare(int start,
int end,
String compareTo)
- Returns:
- -1, 0 or +1 if inferior, equal, or superior to the String.
toChars
public CharChunk toChars(CharChunk cc,
Charset encoding)
throws CharConversionException
- Convert a
BufferChunk using the specified encoding.
- Parameters:
charChank - char array to put result to.encoding - the encoding value
- Throws:
Exception
CharConversionException
Copyright © 2010 Oracle Corpration. All Rights Reserved.