Task.Support.CoreSupport
Class ByteBuffer

java.lang.Object
  extended by Task.Support.CoreSupport.ByteBuffer
All Implemented Interfaces:
java.io.Serializable, ConstantsIF, MIMETypeConstantsIF

public class ByteBuffer
extends java.lang.Object
implements ConstantsIF, java.io.Serializable

ByteBuffer is a container for bytes. A ByteBuffer is to bytes, what a StringBuffer is to Strings.

Since:
3/9/2000,11:54am
Version:
1.0
Author:
Nazmul Idris
See Also:
Serialized Form

Field Summary
static int BUFFER_SIZE
           
protected  byte[] byteRay
           
protected  java.lang.String enc
           
 
Fields inherited from interface Task.Support.CoreSupport.ConstantsIF
ASCII, DEFAULT_CHAR_ENCODING, UTF8
 
Fields inherited from interface Task.Support.CoreSupport.MIMETypeConstantsIF
BINARY_TYPE, CSS_TYPE, GIF_TYPE, HTML_TEXT_TYPE, ICS_TYPE, JPEG_TYPE, MAIL_HOST, MAIL_PORT, MAIL_PSWD, MAIL_USER, MESSAGE_SENT_OK, MP3_AUDIO_TYPE, MPEG_VIDEO_TYPE, MSWORD_TYPE, PDF_TYPE, PLAIN_TEXT_TYPE, PNG_TYPE, RTF_TYPE, SEND_EMAIL, SEND_EMAIL_WITH_ATTACHMENT, TIFF_TYPE, WINDOWS_BMP_TYPE, XML_TYPE, ZIP_TYPE
 
Constructor Summary
ByteBuffer()
           
ByteBuffer(byte[] srcBuf)
           
ByteBuffer(ByteBuffer bb)
           
ByteBuffer(java.io.InputStream is)
          this method does not close the InputStream.
 
Method Summary
 void append(byte[] srcBuf)
           
 ByteBuffer append(byte[] srcBuf, int srcStartIndex, int srcLength)
           
 void append(ByteBuffer buf)
           
protected  void arrayCopy(byte[] srcBuf, int srcStartIndex, byte[] destBuf, int destStartIndex, int numberOfBytesToCopy)
           
 void clear()
           
 byte[] getBytes()
           
 java.io.ByteArrayInputStream getInputStream()
           
 int getSize()
           
static void main(java.lang.String[] args)
           
 void setEncoding(java.lang.String enc)
           
 byte[] toByteArray()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values

byteRay

protected byte[] byteRay

enc

protected java.lang.String enc
Constructor Detail

ByteBuffer

public ByteBuffer()

ByteBuffer

public ByteBuffer(byte[] srcBuf)

ByteBuffer

public ByteBuffer(ByteBuffer bb)

ByteBuffer

public ByteBuffer(java.io.InputStream is)
           throws java.io.IOException
this method does not close the InputStream. Simply reads all data on the stream into a byte buffer.

Throws:
java.io.IOException
Method Detail

append

public ByteBuffer append(byte[] srcBuf,
                         int srcStartIndex,
                         int srcLength)

toByteArray

public byte[] toByteArray()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setEncoding

public void setEncoding(java.lang.String enc)

arrayCopy

protected final void arrayCopy(byte[] srcBuf,
                               int srcStartIndex,
                               byte[] destBuf,
                               int destStartIndex,
                               int numberOfBytesToCopy)

getBytes

public byte[] getBytes()

getInputStream

public java.io.ByteArrayInputStream getInputStream()

getSize

public int getSize()

append

public void append(byte[] srcBuf)

append

public void append(ByteBuffer buf)

clear

public void clear()

main

public static void main(java.lang.String[] args)


Copyright © 2011. All Rights Reserved.