|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectShortCapabilityBlock
Short capability blocks are means of storing a capability block in two bytes instead of sixteen. Almost all of the official sixteen-byte AIM capability blocks contain fourteen of the same bytes. That is, most of AIM's capability blocks are of the form:
09 46 ?? ?? 4c 7f 11 d1 82 22 44 45 53 54 00 00A short capability block only stores the values of the two bytes that vary between most of AIM's capabilities.
CapabilityBlocks.
| Constructor Summary | |
ShortCapabilityBlock(ByteBlock data)
Creates a new short capability block object with the given two-byte block of data. |
|
| Method Summary | |
static boolean |
couldBeShortBlock(CapabilityBlock cap)
Returns whether the given long capability block fits the form of the "family" of capability blocks that can be represented as short capability blocks. |
boolean |
equals(java.lang.Object obj)
Returns whether this object is equal to the given object. |
ByteBlock |
getData()
Returns the two bytes of data contained in this short capability block. |
static ShortCapabilityBlock |
getShortBlock(CapabilityBlock cap)
Returns a short capability block that represents the given long capability block. |
long |
getWritableLength()
Returns the length of the data that was or will be written in a call to write. |
int |
hashCode()
|
static ShortCapabilityBlock[] |
readShortCaps(ByteBlock block)
Reads a sequence of short capability blocks from the given block of binary data. |
CapabilityBlock |
toCapabilityBlock()
Returns the CapabilityBlock that this short capability block
represents. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream out)
Writes a representation of this object to the given stream. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ShortCapabilityBlock(ByteBlock data)
throws java.lang.IllegalArgumentException
data - the two-byte block of data that this short capability block
should contain
java.lang.IllegalArgumentException - if the given block of data contains more
or fewer than two bytes| Method Detail |
public static ShortCapabilityBlock[] readShortCaps(ByteBlock block)
null;
if no short capability blocks are present in the given block of data,
an empty array will be returned.
block - a block of data containing a sequence of zero or more short
capability blocks
public static boolean couldBeShortBlock(CapabilityBlock cap)
cap - the capability block to check
public static ShortCapabilityBlock getShortBlock(CapabilityBlock cap)
throws java.lang.IllegalArgumentException
cap - the capability block to convert to a short capability block
java.lang.IllegalArgumentException - if the given capability block cannot
be represented as a short capability blockpublic final ByteBlock getData()
public final CapabilityBlock toCapabilityBlock()
CapabilityBlock that this short capability block
represents.
CapabilityBlock equivalent to this short
capability blockpublic long getWritableLength()
Writablewrite. The value returned by this method must not
change after its first invocation.
getWritableLength in interface Writablewrite
public void write(java.io.OutputStream out)
throws java.io.IOException
WritablegetWritableLength.
write in interface Writableout - the stream to which to write
java.io.IOException - if an I/O error occurspublic boolean equals(java.lang.Object obj)
false for all objects which are not
ShortCapabilityBlocks - even CapabilityBlocks.
obj - the object to compare for equality
public int hashCode()
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||