Methods Summary |
---|
public boolean | getFlag(int flag)Returns the status of the specified flag.
return (getFlags() & flag) != 0;
|
public int | getFlags()Returns the flags currently in use for this message.
return flags;
|
static java.lang.String | getOEMEncoding()
return OEM_ENCODING;
|
static byte[] | readSecurityBuffer(byte[] src, int index)
int length = readUShort(src, index);
int offset = readULong(src, index + 4);
byte[] buffer = new byte[length];
System.arraycopy(src, offset, buffer, 0, length);
return buffer;
|
static int | readULong(byte[] src, int index)
return (src[index] & 0xff) |
((src[index + 1] & 0xff) << 8) |
((src[index + 2] & 0xff) << 16) |
((src[index + 3] & 0xff) << 24);
|
static int | readUShort(byte[] src, int index)
return (src[index] & 0xff) | ((src[index + 1] & 0xff) << 8);
|
public void | setFlag(int flag, boolean value)Sets or clears the specified flag.
setFlags(value ? (getFlags() | flag) :
(getFlags() & (0xffffffff ^ flag)));
|
public void | setFlags(int flags)Sets the flags for this message.
this.flags = flags;
|
public abstract byte[] | toByteArray()Returns the raw byte representation of this message.
|
static void | writeSecurityBuffer(byte[] dest, int offset, int bodyOffset, byte[] src)
int length = (src != null) ? src.length : 0;
if (length == 0) return;
writeUShort(dest, offset, length);
writeUShort(dest, offset + 2, length);
writeULong(dest, offset + 4, bodyOffset);
System.arraycopy(src, 0, dest, bodyOffset, length);
|
static void | writeULong(byte[] dest, int offset, int ulong)
dest[offset] = (byte) (ulong & 0xff);
dest[offset + 1] = (byte) (ulong >> 8 & 0xff);
dest[offset + 2] = (byte) (ulong >> 16 & 0xff);
dest[offset + 3] = (byte) (ulong >> 24 & 0xff);
|
static void | writeUShort(byte[] dest, int offset, int ushort)
dest[offset] = (byte) (ushort & 0xff);
dest[offset + 1] = (byte) (ushort >> 8 & 0xff);
|