All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.vdheide.mp3.ByteBuilder

java.lang.Object
   |
   +----de.vdheide.mp3.ByteBuilder

public class ByteBuilder
extends Object
This does the opposite of Parser, i.e. it takes Strings or byte array, parses them and adds them to a byte array.

Text encoding is set with one of the constants: NONE: ISO-8859-1 and no encoding byte ISO: ISO-8859-1 and encoding byte UNICODE: Unicode and encoding byte


Variable Index

 o ISO
 o NONE
 o UNICODE

Constructor Index

 o ByteBuilder(byte)
Creates a new instance
 o ByteBuilder(byte, int)
Creates a new instance with an estimation of the size needed.

Method Index

 o getBytes()
Read contents as byte array
 o put(byte)
Write a single byte to the end of the so far saved contents.
 o put(byte[])
Write a byte array to the end of the contents saved so far.
 o put(String)
Write a text according to the selected encoding

Variables

 o NONE
 public static final byte NONE
 o ISO
 public static final byte ISO
 o UNICODE
 public static final byte UNICODE

Constructors

 o ByteBuilder
 public ByteBuilder(byte encoding)
Creates a new instance

Parameters:
encoding - Encoding to use (see above)
 o ByteBuilder
 public ByteBuilder(byte encoding,
                    int size)
Creates a new instance with an estimation of the size needed. It is most efficient when this estimation is the real size, but it creates no error if it is not.

Text encoding is set with one of the constants: NONE: ISO-8859-1 and no encoding byte ISO: ISO-8859-1 and encoding byte UNICODE: Unicode and encoding byte

Parameters:
encoding - Encoding to use (see above)
size - Size estimate

Methods

 o put
 public void put(byte put)
Write a single byte to the end of the so far saved contents.

Parameters:
put - Byte to insert
 o put
 public void put(byte put[])
Write a byte array to the end of the contents saved so far.

Parameters:
put - Byte array to insert
 o put
 public void put(String put)
Write a text according to the selected encoding

Parameters:
put - Text to write
 o getBytes
 public byte[] getBytes()
Read contents as byte array


All Packages  Class Hierarchy  This Package  Previous  Next  Index