com.sun.mail.iap
Class ByteArray

java.lang.Object
  extended by com.sun.mail.iap.ByteArray

public class ByteArray
extends java.lang.Object

A simple wrapper around a byte array, with a start position and count of bytes.

Version:
1.7, 07/05/04
Author:
John Mani

Constructor Summary
ByteArray(byte[] b, int start, int count)
          Constructor
ByteArray(int size)
          Constructor that creates a byte array of the specified size.
 
Method Summary
 byte[] getBytes()
          Returns the internal byte array.
 int getCount()
          Returns the count of bytes
 byte[] getNewBytes()
          Returns a new byte array that is a copy of the data.
 int getStart()
          Returns the start position
 void grow(int incr)
          Grow the byte array by incr bytes.
 void setCount(int count)
          Set the count of bytes.
 java.io.ByteArrayInputStream toByteArrayInputStream()
          Returns a ByteArrayInputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArray

public ByteArray(byte[] b,
                 int start,
                 int count)
Constructor


ByteArray

public ByteArray(int size)
Constructor that creates a byte array of the specified size.

Since:
JavaMail 1.4.1
Method Detail

getBytes

public byte[] getBytes()
Returns the internal byte array. Note that this is a live reference to the actual data, not a copy.


getNewBytes

public byte[] getNewBytes()
Returns a new byte array that is a copy of the data.


getStart

public int getStart()
Returns the start position


getCount

public int getCount()
Returns the count of bytes


setCount

public void setCount(int count)
Set the count of bytes.

Since:
JavaMail 1.4.1

toByteArrayInputStream

public java.io.ByteArrayInputStream toByteArrayInputStream()
Returns a ByteArrayInputStream.


grow

public void grow(int incr)
Grow the byte array by incr bytes.

Since:
JavaMail 1.4.1


Copyright © 2012. All Rights Reserved.