    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.protocol.http.micp.MICPReadWrite

    java.lang.Object
       |
       +----w3c.www.protocol.http.micp.MICPReadWrite

public class MICPReadWrite
extends Object
implements MICP

A class to parse/emit MICP messages.

##

MICPReadWrite()

##

decode(byte[], int, MICPMessage)
  Parse the given buffer as an mICP message.
encode(int, int, int, String, byte[])
  Emit an MICP message into provided buffer.

##

MICPReadWrite

     public MICPReadWrite()

##

decode

     public MICPMessage decode(byte buf[],
                               int len,
                               MICPMessage into) throws MICPProtocolException

  Parse the given buffer as an mICP message.

  Parameters:
    buf - The wire data to parse.
    len - The length of above buffer.
    into - Message structure to fill in.
  Returns:
    The filled in message.
  Throws: 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[])

  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.
    src - The source field for the message.
    id - The identifier of that message.
    url - The URL for that message.
    buf - The buffer to encode the message to.
  Returns:
    A positive integer, giving the message length if buffer was big enough to hold the packet, a negative integer, giving required buffer size otherwise.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index