public class MagicCookie extends Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes() |
static MagicCookie |
parse(byte[] data,
int start)
Parse a magic cookie from the given byte array at the given index.
|
static MagicCookie |
parse(String cookie)
Parse a magic cookie from the given String.
|
void |
setBytes(byte[] data) |
String |
toString() |
public byte[] getBytes()
public void setBytes(byte[] data)
public static MagicCookie parse(String cookie)
cookie - a String which begins with a magic cookie value.MagicCookieIndexOutOfBoundsException - if the string is too short to contain a magic cookie
(four bytes)public static MagicCookie parse(byte[] data, int start)
data - the byte array containing the magic cookie.start - the index of the magic cookie in the byte array.MagicCookie.IndexOutOfBoundsException - if at least four bytes were not present to parse.