| java.lang.Object org.w3c.www.protocol.http.micp.MICPReadWrite
MICPReadWrite | public class MICPReadWrite implements MICP(Code) | | A class to parse/emit MICP messages.
|
Method Summary | |
public MICPMessage | decode(byte buf, int len, MICPMessage into) Parse the given buffer as an mICP message.
Parameters: buf - The wire data to parse. Parameters: len - The length of above buffer. Parameters: into - Message structure to fill in. | public int | encode(int op, int src, int id, String url, byte buf) Emit an MICP message into provided buffer.
If the buffer is too small, a new buffer is allocated in place of
the provided one (and returned).
Parameters: op - The opcode for the message. Parameters: src - The source field for the message. Parameters: id - The identifier of that message. Parameters: url - The URL for that message. Parameters: buf - The buffer to encode the message to. |
decode | public MICPMessage decode(byte buf, int len, MICPMessage into) throws MICPProtocolException(Code) | | Parse the given buffer as an mICP message.
Parameters: buf - The wire data to parse. Parameters: len - The length of above buffer. Parameters: into - Message structure to fill in. The filled in message. exception: MICPProtocolException - If the given buffer is not an mICP wire formatted message. |
encode | public int encode(int op, int src, int id, String url, byte buf)(Code) | | Emit an MICP message into provided buffer.
If the buffer is too small, a new buffer is allocated in place of
the provided one (and returned).
Parameters: op - The opcode for the message. Parameters: src - The source field for the message. Parameters: id - The identifier of that message. Parameters: url - The URL for that message. Parameters: buf - The buffer to encode the message to. A positive integer, giving the message length if buffer was bigenough to hold the packet, a negative integer, giving required buffersize otherwise. |
|
|