|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectExtraInfoBlockHolder
A data structure used to hold ExtraInfoBlock
s and some sort of code.
As of this writing, this structure is only used in ExtraInfoAck
commands, and any advantages to
sending ExtraInfoBlock
s directly is unknown.
ExtraInfoAck
Field Summary | |
static int |
CODE_DEFAULT
The code value sent by default by the AIM server. |
Constructor Summary | |
|
ExtraInfoBlockHolder(ExtraInfoBlock both)
Creates an extra info block holder whose blocks are both set to the given block and with a code value of CODE_DEFAULT . |
|
ExtraInfoBlockHolder(ExtraInfoBlock first,
int code,
ExtraInfoBlock second)
Creates a new ExtraInfoBlockHolder with the given
properties. |
protected |
ExtraInfoBlockHolder(ExtraInfoBlock first,
int code,
ExtraInfoBlock second,
int totalSize)
Creates a new ExtraInfoBlockHolder with the given
properties. |
Method Summary | |
int |
getCode()
The numeric code contained in this extra info block holder. |
ExtraInfoBlock |
getFirstBlock()
Returns the first extra info block contained in this extra info block holder. |
ExtraInfoBlock |
getSecondBlock()
Returns the second extra info block contained in this extra info block holder. |
int |
getTotalSize()
Returns the number of bytes read to create this object, if read from an incoming block of binary data with readBlockHolder . |
long |
getWritableLength()
Returns the length of the data that was or will be written in a call to write . |
static ExtraInfoBlockHolder |
readBlockHolder(ByteBlock block)
Reads an ExtraInfoBlockHolder from the given block of binary
data. |
static ExtraInfoBlockHolder[] |
readBlockHolders(ByteBlock block)
Reads a series of ExtraInfoBlockHolder s from the given block
of binary data. |
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CODE_DEFAULT
Constructor Detail |
protected ExtraInfoBlockHolder(ExtraInfoBlock first, int code, ExtraInfoBlock second, int totalSize)
ExtraInfoBlockHolder
with the given
properties.
first
- the first ExtraInfoBlock
to hold in this block
holdercode
- the numeric code to hold in this block holdersecond
- the second ExtraInfoBlock
to hold in this
block holdertotalSize
- the total number of bytes read to create this object,
if read from an incoming block of binary datapublic ExtraInfoBlockHolder(ExtraInfoBlock both)
CODE_DEFAULT
. As of this writing,
this is the only format used.
both
- the extra info block to use as both the first and second
blockspublic ExtraInfoBlockHolder(ExtraInfoBlock first, int code, ExtraInfoBlock second)
ExtraInfoBlockHolder
with the given
properties.
first
- the first ExtraInfoBlock
to hold in this block
holdercode
- the numeric code to hold in this block holder, like CODE_DEFAULT
second
- the second ExtraInfoBlock
to hold in this
block holderMethod Detail |
public static final ExtraInfoBlockHolder readBlockHolder(ByteBlock block)
ExtraInfoBlockHolder
from the given block of binary
data. The total number of bytes read can be obtained by calling the
getTotalSize()
method of the returned object. Note that if no
valid extra info block holder object can be read, this method will return
null
.
block
- a block of data containing an extra info block holder object
null
if none could be readpublic static final ExtraInfoBlockHolder[] readBlockHolders(ByteBlock block)
ExtraInfoBlockHolder
s from the given block
of binary data. Note that this method will never return
null
; if no extra info block holder objects can be read from
the given block of data, an empty array is returned. The total number of
bytes read can be obtained by adding the results of calling getTotalSize()
on each of the elements of the returned array.
block
- a block of data containing a sequence of zero or more
ExtraInfoBlock
s
ExtraInfoBlock
objects read from the
given block of binary datapublic final ExtraInfoBlock getFirstBlock()
public final int getCode()
CODE_DEFAULT
.
public final ExtraInfoBlock getSecondBlock()
public final int getTotalSize()
readBlockHolder
.
public long getWritableLength()
Writable
write
. The value returned by this method must not
change after its first invocation.
getWritableLength
in interface Writable
write
public void write(java.io.OutputStream out) throws java.io.IOException
Writable
getWritableLength
.
write
in interface Writable
out
- the stream to which to write
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |