public class DataChunk extends Object implements Chunk
Buffer
chunk representation.
Helps HTTP module to avoid redundant String creation.Modifier and Type | Class and Description |
---|---|
static class |
DataChunk.Type |
Modifier | Constructor and Description |
---|---|
protected |
DataChunk() |
protected |
DataChunk(ByteChunk byteChunk,
BufferChunk bufferChunk,
CharChunk charChunk,
String stringValue) |
Modifier and Type | Method and Description |
---|---|
void |
delete(int from,
int to) |
void |
duplicate(DataChunk src)
Copy the src into this DataChunk, allocating more space if needed
|
boolean |
equals(BufferChunk bufferChunkToCheck)
Compares the message data to the specified BufferChunk.
|
boolean |
equals(byte[] bytes)
Compares the message data to the specified byte[].
|
boolean |
equals(byte[] bytes,
int start,
int len)
Compares the message data to the specified byte[].
|
boolean |
equals(ByteChunk byteChunkToCheck)
Compares the message data to the specified ByteChunk.
|
boolean |
equals(CharChunk charChunkToCheck)
Compares the message data to the specified CharChunk.
|
boolean |
equals(Object object)
Compares this DataChunk and the passed object.
|
boolean |
equals(String s)
Compares the message bytes to the specified String object.
|
boolean |
equalsIgnoreCase(BufferChunk bufferChunkToCheck)
Compares the message data to the specified BufferChunk ignoring case considerations.
|
boolean |
equalsIgnoreCase(byte[] bytes)
Compares the message data to the specified byte[] ignoring case considerations.
|
boolean |
equalsIgnoreCase(byte[] bytes,
int start,
int len)
Compares the message data to the specified byte[] ignoring case considerations.
|
boolean |
equalsIgnoreCase(ByteChunk byteChunkToCheck)
Compares the message data to the specified ByteChunk ignoring case considerations.
|
boolean |
equalsIgnoreCase(CharChunk charChunkToCheck)
Compares the message data to the specified CharChunk ignoring case considerations.
|
boolean |
equalsIgnoreCase(Object object)
Compares this DataChunk and the passed object ignoring case considerations.
|
boolean |
equalsIgnoreCase(String s)
Compares the message bytes to the specified String object ignoring case considerations.
|
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
|
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) |
protected DataChunk()
protected DataChunk(ByteChunk byteChunk, BufferChunk bufferChunk, CharChunk charChunk, String stringValue)
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
CharConversionException
public int getLength()
public int getStart()
public void setStart(int start)
public int getEnd()
public void setEnd(int end)
public final int indexOf(char c, int fromIndex)
public final int indexOf(String s, int fromIndex)
public boolean equals(Object object)
public boolean equals(String s)
s
- the String to comparepublic boolean equals(ByteChunk byteChunkToCheck)
byteChunkToCheck
- the ByteChunk to comparepublic boolean equals(BufferChunk bufferChunkToCheck)
bufferChunkToCheck
- the BufferChunk to comparepublic boolean equals(CharChunk charChunkToCheck)
charChunkToCheck
- the CharChunk to comparepublic boolean equals(byte[] bytes)
bytes
- the byte[] to comparepublic boolean equals(byte[] bytes, int start, int len)
bytes
- the byte[] to comparepublic boolean equalsIgnoreCase(Object object)
object
- the Object to comparepublic boolean equalsIgnoreCase(String s)
s
- the String to comparepublic boolean equalsIgnoreCase(ByteChunk byteChunkToCheck)
byteChunkToCheck
- the ByteChunk to comparepublic boolean equalsIgnoreCase(BufferChunk bufferChunkToCheck)
bufferChunkToCheck
- the BufferChunk to comparepublic boolean equalsIgnoreCase(CharChunk charChunkToCheck)
charChunkToCheck
- the CharChunk to comparepublic boolean equalsIgnoreCase(byte[] bytes)
bytes
- the byte[] to comparepublic boolean equalsIgnoreCase(byte[] bytes, int start, int len)
bytes
- the byte[] to comparepublic int hashCode()
public final boolean equalsIgnoreCaseLowerCase(byte[] b)
b
- the byte[]
to comparepublic final boolean startsWith(String s, int pos)
true
if the DataChunk
starts with
the specified string.s
- the stringpos
- The start positiontrue
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 positiontrue
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()
Copyright © 2015 Oracle Corporation. All rights reserved.