|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openorb.io.MarshalBuffer
MarshalBuffers serve as a sink for data to be marshaled into. Fragmentation of the data as it is marshaled can be controlled by the Listener registered with the buffer at creation time.
Inner Class Summary | |
static interface |
MarshalBuffer.BlockGenerator
Interface BlockGenerator. |
static interface |
MarshalBuffer.HeaderGenerator
Interface HeaderGenerator. |
static interface |
MarshalBuffer.Listener
|
Constructor Summary | |
MarshalBuffer()
Construct marshal buffer without listener. |
|
MarshalBuffer(MarshalBuffer.Listener listener,
java.lang.Object listenerCookie)
Construct marshall buffer with listener. |
Method Summary | |
void |
addHeader(MarshalBuffer.HeaderGenerator gen,
int len,
boolean frag,
java.lang.Object cookie)
Add a header generator. |
void |
alloc(OctetSeqHolder buf,
IntHolder off,
int len)
Alocate space at end of buffer. |
void |
append(byte[] buf,
int off,
int len)
Attach a readonly scrap to the end of the buffer. |
int |
available()
count of all bytes available for extracting into a fragment. |
void |
beginBlock(MarshalBuffer.BlockGenerator gen,
int len,
boolean frag,
java.lang.Object cookie)
Begin a block. |
void |
cancel(SystemException ex)
Cancel marshal. |
void |
close()
Close. |
void |
endBlock()
Call the endBlock operation on the last block written with the beginBlock operation and remove the hold on the data. |
StorageBuffer |
fragment(int len)
Prepare fragment. |
boolean |
getAllowFragment()
Test if fragmentation is currently enabled. |
boolean |
isStandalone()
Returns true if not connected to a listener. |
StorageBuffer |
lastFragment()
Return the last fragment. |
static void |
main(java.lang.String[] args)
|
void |
pad(int len)
Insert padding. |
void |
setAllowFragment(boolean allowFragment)
Allow or dissallow fragmentation. |
int |
size()
count of all bytes inserted into the buffer, including previous fragments |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MarshalBuffer()
public MarshalBuffer(MarshalBuffer.Listener listener, java.lang.Object listenerCookie)
Method Detail |
public boolean isStandalone()
public int size()
public int available()
public void setAllowFragment(boolean allowFragment)
public boolean getAllowFragment()
public void alloc(OctetSeqHolder buf, IntHolder off, int len)
buf
- Out parameter, holds pointer to scratch space on
return. This space should not be stored. The pointer will be
invalidated by setting it's value to null on next call.off
- Out parameter, holds buffer offset on return.len
- Length of requested buffer.public void append(byte[] buf, int off, int len)
public void pad(int len)
public void addHeader(MarshalBuffer.HeaderGenerator gen, int len, boolean frag, java.lang.Object cookie)
gen
- the header generatorlen
- the length of the data which will be written by the generator.frag
- true if the header allows fragmentation to occour within it's
range of authority.cookie
- passed to the begin message and end message operations.public void beginBlock(MarshalBuffer.BlockGenerator gen, int len, boolean frag, java.lang.Object cookie)
Nonfragmentable blocks can be nested, however fragmentable blocks cannot.
gen
- the block generator.len
- the length of the data which will be written.frag
- true if the block can be fragmented.cookie
- passed to the fragment block and end block operation.public void endBlock()
public void close()
public void cancel(SystemException ex)
public StorageBuffer fragment(int len)
public StorageBuffer lastFragment()
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |