|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.http.util.DataChunk
public class DataChunk
Buffer chunk representation.
Helps HTTP module to avoid redundant String creation.
| Nested Class Summary | |
|---|---|
static class |
DataChunk.Type
|
| Constructor Summary | |
|---|---|
protected |
DataChunk()
|
protected |
DataChunk(ByteChunk byteChunk,
BufferChunk bufferChunk,
CharChunk charChunk,
String stringValue)
|
| Method Summary | |
|---|---|
void |
delete(int from,
int to)
|
void |
duplicate(DataChunk src)
Copy the src into this DataChunk, allocating more space if needed |
boolean |
equals(String s)
Compares the message bytes to the specified String object. |
boolean |
equalsIgnoreCase(byte[] b)
Compares the message bytes to the specified String object. |
boolean |
equalsIgnoreCase(String s)
Compares the message bytes to the specified String object. |
boolean |
equalsIgnoreCaseLowerCase(byte[] b)
Compares the data chunk to the specified byte array representing lower-case ASCII characters. |
BufferChunk |
getBufferChunk()
|
ByteChunk |
getByteChunk()
|
CharChunk |
getCharChunk()
|
int |
getEnd()
Returns the DataChunk end position. |
int |
getLength()
Returns the DataChunk length. |
int |
getStart()
Returns the DataChunk start position. |
DataChunk.Type |
getType()
|
int |
hashCode()
Returns DataChunk hash code. |
int |
indexOf(char c,
int fromIndex)
Returns true if the message bytes starts with the specified string. |
int |
indexOf(String s,
int fromIndex)
Returns true if the message bytes starts with the specified string. |
boolean |
isNull()
|
static DataChunk |
newInstance()
|
static DataChunk |
newInstance(ByteChunk byteChunk,
BufferChunk bufferChunk,
CharChunk charChunk,
String stringValue)
|
void |
notifyDirectUpdate()
Notify the Chunk that its content is going to be changed directly |
protected void |
onContentChanged()
|
void |
recycle()
|
protected void |
reset()
|
protected void |
resetBuffer()
|
protected void |
resetByteChunk()
|
protected void |
resetCharChunk()
|
protected void |
resetString()
|
void |
set(DataChunk value)
|
void |
set(DataChunk value,
int start,
int end)
|
void |
setBuffer(Buffer buffer)
|
void |
setBuffer(Buffer buffer,
int position,
int limit)
|
void |
setBytes(byte[] bytes)
|
void |
setBytes(byte[] bytes,
int position,
int limit)
|
void |
setChars(char[] chars,
int position,
int limit)
|
void |
setEnd(int end)
Sets the DataChunk end position. |
void |
setStart(int start)
Sets the DataChunk start position. |
void |
setString(String string)
|
boolean |
startsWith(String s,
int pos)
Returns true if the DataChunk starts with
the specified string. |
boolean |
startsWithIgnoreCase(String s,
int pos)
Returns true if the DataChunk starts with
the specified string. |
void |
toChars(Charset charset)
|
DataChunk |
toImmutable()
|
String |
toString()
|
String |
toString(Charset charset)
|
String |
toString(int start,
int end)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected DataChunk()
protected DataChunk(ByteChunk byteChunk,
BufferChunk bufferChunk,
CharChunk charChunk,
String stringValue)
| Method Detail |
|---|
public static DataChunk newInstance()
public static DataChunk newInstance(ByteChunk byteChunk,
BufferChunk bufferChunk,
CharChunk charChunk,
String stringValue)
public DataChunk toImmutable()
public DataChunk.Type getType()
public void set(DataChunk value)
public void set(DataChunk value,
int start,
int end)
public void notifyDirectUpdate()
public BufferChunk getBufferChunk()
public void setBuffer(Buffer buffer,
int position,
int limit)
public void setBuffer(Buffer buffer)
public CharChunk getCharChunk()
public void setChars(char[] chars,
int position,
int limit)
public ByteChunk getByteChunk()
public void setBytes(byte[] bytes)
public void setBytes(byte[] bytes,
int position,
int limit)
public void setString(String string)
public void duplicate(DataChunk src)
public void toChars(Charset charset)
throws CharConversionException
CharConversionExceptionpublic String toString()
toString in class Objectpublic String toString(Charset charset)
protected void onContentChanged()
public int getLength()
getLength in interface Chunkpublic int getStart()
getStart in interface Chunkpublic void setStart(int start)
setStart in interface Chunkstart - the DataChunk start position.public int getEnd()
getEnd in interface Chunkpublic void setEnd(int end)
setEnd in interface Chunkend - the DataChunk end position.
public final int indexOf(char c,
int fromIndex)
indexOf in interface Chunkc - the characterfromIndex - The start position
public final int indexOf(String s,
int fromIndex)
indexOf in interface Chunks - the stringfromIndex - The start position
public final void delete(int from,
int to)
delete in interface Chunk
public String toString(int start,
int end)
toString in interface Chunkpublic boolean equals(String s)
s - the String to compare
public int hashCode()
hashCode in class Objectpublic boolean equalsIgnoreCase(String s)
s - the String to compare
public final boolean equalsIgnoreCase(byte[] b)
b - the byte[] to compare
public final boolean equalsIgnoreCaseLowerCase(byte[] b)
b - the byte[] to compare
public final boolean startsWith(String s,
int pos)
true if the DataChunk starts with
the specified string.
s - the stringpos - The start position
true if the DataChunk starts with
the specified string.
public final boolean startsWithIgnoreCase(String s,
int pos)
true if the DataChunk starts with
the specified string.
s - the stringpos - The start position
true if the DataChunk starts with
the specified string.public final boolean isNull()
protected void resetBuffer()
protected void resetCharChunk()
protected void resetByteChunk()
protected void resetString()
protected void reset()
public void recycle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||