Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.io.util
Class ByteArray  view ByteArray download ByteArray.java

java.lang.Object
  extended byorg.activemq.io.util.ByteArray

public class ByteArray
extends java.lang.Object

Simple holder for a an array of Bytes - used instead of a ByteBuffer to avoid unecessary System.array() copies

Version:
$Revision: 1.1.1.1 $

Field Summary
private  byte[] buf
           
private  int length
           
private  int offset
           
 
Constructor Summary
ByteArray()
          Construct an empty ByteArray
ByteArray(byte[] buf)
          Create a byte array
ByteArray(byte[] buf, int offset, int length)
          Create a ByteArray
 
Method Summary
 void clear()
          clear the values held by this ByteArray
 ByteArray copy()
          make a copy
 byte get(int position)
          return the byte at the position
 byte[] getBuf()
           
 int getLength()
           
 int getOffset()
           
 void reset(byte[] buf)
          reset values
 void reset(byte[] buf, int offset, int length)
          reset values
 void setBuf(byte[] buf)
           
 void setLength(int length)
           
 void setOffset(int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

private byte[] buf

offset

private int offset

length

private int length
Constructor Detail

ByteArray

public ByteArray()
Construct an empty ByteArray


ByteArray

public ByteArray(byte[] buf)
Create a byte array


ByteArray

public ByteArray(byte[] buf,
                 int offset,
                 int length)
Create a ByteArray

Method Detail

clear

public void clear()
clear the values held by this ByteArray


reset

public void reset(byte[] buf)
reset values


reset

public void reset(byte[] buf,
                  int offset,
                  int length)
reset values


getBuf

public byte[] getBuf()

setBuf

public void setBuf(byte[] buf)

getLength

public int getLength()

setLength

public void setLength(int length)

getOffset

public int getOffset()

setOffset

public void setOffset(int offset)

get

public byte get(int position)
return the byte at the position


copy

public ByteArray copy()
make a copy