Package io.undertow.util
Class HttpString
java.lang.Object
io.undertow.util.HttpString
- All Implemented Interfaces:
Serializable,Comparable<HttpString>
@Deprecated
public final class HttpString
extends Object
implements Comparable<HttpString>, Serializable
Deprecated.
An HTTP case-insensitive Latin-1 string.
- Author:
- David M. Lloyd
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpString(byte[] bytes) Deprecated.Construct a new instance.HttpString(byte[] bytes, int offset, int length) Deprecated.Construct a new instance.HttpString(String string) Deprecated.Construct a new instance from aString.HttpString(ByteBuffer buffer) Deprecated.Construct a new instance by reading the remaining bytes from a buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendTo(ByteBuffer buffer) Deprecated.Append to a byte buffer.bytebyteAt(int idx) Deprecated.Get the byte at an index.intcompareTo(HttpString other) Deprecated.Compare this string to another in a case-insensitive manner.voidcopyTo(byte[] dst, int offs) Deprecated.Copy all the bytes from this string to the given array at the given offset.voidcopyTo(byte[] dst, int offs, int len) Deprecated.Copylenbytes from this string to the given array at the given offset.voidcopyTo(int srcOffs, byte[] dst, int offs, int len) Deprecated.Copylenbytes from this string at offsetsrcOffsto the given array at the given offset.booleanequals(HttpString other) Deprecated.Determine if thisHttpStringis equal to another.booleanDeprecated.Determine if thisHttpStringis equal to another.booleanequalToString(String headerName) Deprecated.inthashCode()Deprecated.Get the hash code.intlength()Deprecated.Get the string length.toString()Deprecated.Get theStringrepresentation of thisHttpString.static HttpStringtryFromString(String string) Deprecated.Attempt to convert aStringto anHttpString.voidwriteTo(OutputStream output) Deprecated.Append to an output stream.
-
Field Details
-
EMPTY
Deprecated.Empty HttpString instance.
-
-
Constructor Details
-
HttpString
public HttpString(byte[] bytes) Deprecated.Construct a new instance.- Parameters:
bytes- the byte array to copy
-
HttpString
public HttpString(byte[] bytes, int offset, int length) Deprecated.Construct a new instance.- Parameters:
bytes- the byte array to copyoffset- the offset into the array to start copyinglength- the number of bytes to copy
-
HttpString
Deprecated.Construct a new instance by reading the remaining bytes from a buffer.- Parameters:
buffer- the buffer to read
-
HttpString
Deprecated.Construct a new instance from aString. TheStringwill be used as the cachedtoString()value for thisHttpString.- Parameters:
string- the source string
-
-
Method Details
-
tryFromString
Deprecated.Attempt to convert aStringto anHttpString. If the string cannot be converted,nullis returned.- Parameters:
string- the string to try- Returns:
- the HTTP string, or
nullif the string is not in a compatible encoding
-
length
public int length()Deprecated.Get the string length.- Returns:
- the string length
-
byteAt
public byte byteAt(int idx) Deprecated.Get the byte at an index.- Returns:
- the byte at an index
-
copyTo
public void copyTo(int srcOffs, byte[] dst, int offs, int len) Deprecated.Copylenbytes from this string at offsetsrcOffsto the given array at the given offset.- Parameters:
srcOffs- the source offsetdst- the destinationoffs- the destination offsetlen- the number of bytes to copy
-
copyTo
public void copyTo(byte[] dst, int offs, int len) Deprecated.Copylenbytes from this string to the given array at the given offset.- Parameters:
dst- the destinationoffs- the destination offsetlen- the number of bytes
-
copyTo
public void copyTo(byte[] dst, int offs) Deprecated.Copy all the bytes from this string to the given array at the given offset.- Parameters:
dst- the destinationoffs- the destination offset
-
appendTo
Deprecated.Append to a byte buffer.- Parameters:
buffer- the buffer to append to
-
writeTo
Deprecated.Append to an output stream.- Parameters:
output- the stream to write to- Throws:
IOException- if an error occurs
-
compareTo
Deprecated.Compare this string to another in a case-insensitive manner.- Specified by:
compareToin interfaceComparable<HttpString>- Parameters:
other- the other string- Returns:
- -1, 0, or 1
-
hashCode
public int hashCode()Deprecated.Get the hash code. -
equals
Deprecated.Determine if thisHttpStringis equal to another. -
equals
Deprecated.Determine if thisHttpStringis equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
toString
Deprecated.Get theStringrepresentation of thisHttpString. -
equalToString
Deprecated.
-