Package org.glassfish.grizzly.http.util
Class BufferChunk
- java.lang.Object
-
- org.glassfish.grizzly.http.util.BufferChunk
-
-
Constructor Summary
Constructors Constructor Description BufferChunk()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallocate(int size)voidappend(BufferChunk bc)intcompare(int start, int end, String compareTo)intcompareIgnoreCase(int start, int end, String compareTo)voiddelete(int start, int end)booleanequals(byte[] b)Compares the message Buffer to the specified byte array.booleanequals(byte[] b, int offset, int len)Compares the message Buffer to the specified byte array.static booleanequals(byte[] c, int cOff, int cLen, org.glassfish.grizzly.Buffer t, int tOff, int tLen)booleanequals(char[] b, int offset, int len)Compares the message Buffer to the specified char array.booleanequals(CharSequence s)booleanequals(Object o)booleanequalsIgnoreCase(byte[] b)booleanequalsIgnoreCase(byte[] b, int offset, int len)booleanequalsIgnoreCase(char[] b, int offset, int len)Compares the message Buffer to the specified char array ignoring case considerations.booleanequalsIgnoreCase(CharSequence s)booleanequalsIgnoreCase(Object o)booleanequalsIgnoreCaseLowerCase(byte[] b)Compares the buffer chunk to the specified byte array representing lower-case ASCII characters.static booleanequalsIgnoreCaseLowerCase(org.glassfish.grizzly.Buffer buffer, int start, int end, byte[] cmpTo)Compares the buffer chunk to the specified byte array representing lower-case ASCII characters.intfindBytesAscii(byte[] b)Returns the starting index of the specified byte sequence within thisBuffer.org.glassfish.grizzly.BuffergetBuffer()intgetEnd()intgetLength()intgetStart()inthash()inthashCode()intindexOf(char c, int fromIndex)intindexOf(String s, int fromIndex)static intindexOf(org.glassfish.grizzly.Buffer buffer, int off, int end, char qq)static intindexOf(org.glassfish.grizzly.Buffer buffer, int off, int end, CharSequence s)booleanisNull()protected voidnotifyDirectUpdate()Notify the Chunk that its content is going to be changed directlyvoidrecycle()protected voidreset()protected voidresetStringCache()voidsetBuffer(org.glassfish.grizzly.Buffer buffer)voidsetBufferChunk(org.glassfish.grizzly.Buffer buffer, int start, int end)voidsetBufferChunk(org.glassfish.grizzly.Buffer buffer, int start, int end, int limit)voidsetEnd(int end)voidsetStart(int start)static booleanstartsWith(org.glassfish.grizzly.Buffer buffer, int start, int end, byte[] cmpTo)booleanstartsWithIgnoreCase(String s, int pos)StringtoString()StringtoString(int start, int end)StringtoString(Charset charset)voidtrimLeft()
-
-
-
Method Detail
-
setBufferChunk
public void setBufferChunk(org.glassfish.grizzly.Buffer buffer, int start, int end)
-
setBufferChunk
public void setBufferChunk(org.glassfish.grizzly.Buffer buffer, int start, int end, int limit)
-
getBuffer
public org.glassfish.grizzly.Buffer getBuffer()
-
setBuffer
public void setBuffer(org.glassfish.grizzly.Buffer buffer)
-
isNull
public final boolean isNull()
-
allocate
public void allocate(int size)
-
append
public void append(BufferChunk bc)
-
startsWithIgnoreCase
public boolean startsWithIgnoreCase(String s, int pos)
-
findBytesAscii
public int findBytesAscii(byte[] b)
Returns the starting index of the specified byte sequence within thisBuffer.- Parameters:
b- byte sequence to search for.- Returns:
- the starting index of the specified byte sequence within this
Buffer
-
hash
public int hash()
-
equals
public boolean equals(CharSequence s)
-
equals
public boolean equals(byte[] b)
Compares the message Buffer to the specified byte array.- Parameters:
b- thebyte[]to compare- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.3
-
equals
public boolean equals(byte[] b, int offset, int len)Compares the message Buffer to the specified byte array.- Parameters:
b- thebyte[]to compareoffset- the offset in the arraylen- number of bytes to check- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.3
-
equals
public static boolean equals(byte[] c, int cOff, int cLen, org.glassfish.grizzly.Buffer t, int tOff, int tLen)
-
equals
public boolean equals(char[] b, int offset, int len)Compares the message Buffer to the specified char array.- Parameters:
b- thechar[]to compareoffset- the offset in the arraylen- number of chars to check- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.3
-
equalsIgnoreCase
public boolean equalsIgnoreCase(Object o)
-
equalsIgnoreCase
public boolean equalsIgnoreCase(CharSequence s)
-
equalsIgnoreCase
public boolean equalsIgnoreCase(byte[] b)
-
equalsIgnoreCase
public boolean equalsIgnoreCase(byte[] b, int offset, int len)
-
equalsIgnoreCase
public boolean equalsIgnoreCase(char[] b, int offset, int len)Compares the message Buffer to the specified char array ignoring case considerations.- Parameters:
b- thechar[]to compareoffset- the offset in the arraylen- number of chars to check- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.3
-
equalsIgnoreCaseLowerCase
public boolean equalsIgnoreCaseLowerCase(byte[] b)
Compares the buffer chunk to the specified byte array representing lower-case ASCII characters.- Parameters:
b- thebyte[]to compare- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.1.2
-
resetStringCache
protected final void resetStringCache()
-
reset
protected final void reset()
-
recycle
public final void recycle()
-
notifyDirectUpdate
protected void notifyDirectUpdate()
Notify the Chunk that its content is going to be changed directly
-
indexOf
public static int indexOf(org.glassfish.grizzly.Buffer buffer, int off, int end, char qq)
-
indexOf
public static int indexOf(org.glassfish.grizzly.Buffer buffer, int off, int end, CharSequence s)
-
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.
-
equalsIgnoreCaseLowerCase
public static boolean equalsIgnoreCaseLowerCase(org.glassfish.grizzly.Buffer buffer, int start, int end, byte[] cmpTo)Compares the buffer chunk to the specified byte array representing lower-case ASCII characters.- Parameters:
buffer- thebyte[]to comparestart- buffer startend- buffer endcmpTo- byte[] to compare against- Returns:
- true if the comparison succeeded, false otherwise
- Since:
- 2.1.2
-
startsWith
public static boolean startsWith(org.glassfish.grizzly.Buffer buffer, int start, int end, byte[] cmpTo)
-
trimLeft
public void trimLeft()
-
-