SunSPOT API V3.0


com.sun.squawk.io.mailboxes
Class ByteArrayEnvelope

java.lang.Object
  extended by com.sun.squawk.io.mailboxes.Envelope
      extended by com.sun.squawk.io.mailboxes.ByteArrayEnvelope

public class ByteArrayEnvelope
extends Envelope

A ByteArrayEnvelope can be used to pass a byte array, or subsection of a byte array through a Channel.

The specified section of the byte array will be copied as the envelope is being sent to the remote channel.


Constructor Summary
ByteArrayEnvelope(byte[] array)
          Create a ByteArrayEnvelope for the specified array.
ByteArrayEnvelope(byte[] array, int offset, int len)
          Create a ByteArrayEnvelope for the subsection of the specified array.
 
Method Summary
 Object getContents()
          Return the contents of the envelope.
 byte[] getData()
          Return the contents of the envelope, which is a byte array.
 
Methods inherited from class com.sun.squawk.io.mailboxes.Envelope
checkCallContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayEnvelope

public ByteArrayEnvelope(byte[] array)
Create a ByteArrayEnvelope for the specified array.

Parameters:
array - the array of bytes to be sent.

ByteArrayEnvelope

public ByteArrayEnvelope(byte[] array,
                         int offset,
                         int len)
Create a ByteArrayEnvelope for the subsection of the specified array.

Parameters:
array - the array of bytes to be sent.
offset - offset to the first byte in the array to be sent.
len - the number of bytes to be sent.
Method Detail

getContents

public Object getContents()
Return the contents of the envelope.

Specified by:
getContents in class Envelope
Returns:
the contents of the envelope

getData

public byte[] getData()
Return the contents of the envelope, which is a byte array.


SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.