All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.antsr.core.ByteArray
java.lang.Object
   |
   +----edu.utah.janos.antsr.core.ByteArray

  Summary

public class  ByteArray
     extends java.lang.Object
{
          // Fields 3
     public byte[] buf;
     public int len;
     public int offset;

          // Constructors 6
     public ByteArray(byte[]);
     public ByteArray(byte[], int);
     public ByteArray(byte[], int, int) throws IndexOutOfBoundsException;
     public ByteArray(ByteArray, int);
     public ByteArray(ByteArray, int, int) throws IndexOutOfBoundsException;
     public ByteArray(int);

          // Methods 8
     public final byte getByte(int) throws IndexOutOfBoundsException;
     public final void getBytes(int, byte[], int, int);
     public final int length();
     public final void setByte(int, byte) throws IndexOutOfBoundsException;
     public final void setBytes(int, byte[], int, int);
     public final void setBytes(int, ByteArray, int, int);
     public final byte[] toBytes();
     public String toString();
}

Wrapper for an array of Bytes. Incorporates offset and length.

Most of the methods in here are final for performance reasons.

Author:
probably David Wetherall.


  Cross Reference

Returned By:
DataCapsule.getData(), Xdr.BYTEARRAY()





  Fields

· buf

Summary  |  Top
   public byte[] buf


· offset

Summary  |  Top
   public int offset


· len

Summary  |  Top
   public int len


  Constructors

· ByteArray

Summary  |  Top

   public ByteArray(int len) 


· ByteArray

Summary  |  Top
   public ByteArray(byte[] buf) 


· ByteArray

Summary  |  Top
   public ByteArray(byte[] buf, 
                    int offset) 


· ByteArray

Summary  |  Top
   public ByteArray(byte[] buf, 
                    int offset, 
                    int len)  throws IndexOutOfBoundsException


· ByteArray

Summary  |  Top
   public ByteArray(ByteArray parent, 
                    int offset) 


· ByteArray

Summary  |  Top
   public ByteArray(ByteArray parent, 
                    int offset, 
                    int len)  throws IndexOutOfBoundsException


  Methods

· length

Summary  |  Top
   public final int length() 


· getByte

Summary  |  Top
   public final byte getByte(int index)  throws IndexOutOfBoundsException


· setByte

Summary  |  Top
   public final void setByte(int index, 
                             byte val)  throws IndexOutOfBoundsException


· getBytes

Summary  |  Top
   public final void getBytes(int srcBegin, 
                              byte[] dst, 
                              int dstBegin, 
                              int length) 


· setBytes

Summary  |  Top
   public final void setBytes(int dstBegin, 
                              byte[] src, 
                              int srcBegin, 
                              int length) 


· setBytes

Summary  |  Top
   public final void setBytes(int dstBegin, 
                              ByteArray src, 
                              int srcBegin, 
                              int length) 


· toBytes

Summary  |  Top
   public final byte[] toBytes() 

Returns a byte array exactly the right size for the valid data in the buf. Note that if this.buf is the right side it is returned directly, otherwise a new array is created of the right size. (Weird.)

Returns:
array of bytes


· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7