public class MarshalBuffer
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MarshalBuffer.BlockGenerator
Interface BlockGenerator.
|
static interface |
MarshalBuffer.HeaderGenerator
Interface HeaderGenerator.
|
static interface |
MarshalBuffer.Listener
This interface is used by the MarshalBuffer to send important messages
to a registered listener.
|
| Constructor and Description |
|---|
MarshalBuffer()
Construct marshal buffer without listener.
|
MarshalBuffer(MarshalBuffer.Listener listener,
java.lang.Object listenerCookie)
Construct marshall buffer with listener.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(MarshalBuffer.HeaderGenerator gen,
int len,
boolean frag,
java.lang.Object cookie)
Add a header generator.
|
void |
alloc(org.omg.CORBA.OctetSeqHolder buf,
org.omg.CORBA.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(org.omg.CORBA.SystemException ex)
Cancel marshal.
|
void |
close()
Close.
|
void |
enableLogging(Logger logger)
Enable logging for this class.
|
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 a fragment message.
|
boolean |
getAllowFragment()
Test if fragmentation is currently enabled.
|
protected Logger |
getLogger()
Return the logger for this class.
|
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()
Counts of all bytes inserted into the buffer, including previous
fragments.
|
public MarshalBuffer()
public MarshalBuffer(MarshalBuffer.Listener listener, java.lang.Object listenerCookie)
public void enableLogging(Logger logger)
logger - The logger instance.protected Logger getLogger()
public boolean isStandalone()
public int size()
public int available()
public void setAllowFragment(boolean allowFragment)
public boolean getAllowFragment()
public void alloc(org.omg.CORBA.OctetSeqHolder buf,
org.omg.CORBA.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)
len - The number of bytes to add.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(org.omg.CORBA.SystemException ex)
public StorageBuffer fragment(int len)
public StorageBuffer lastFragment()
public static void main(java.lang.String[] args)