railo.commons.lang
Class ByteBuffer

java.lang.Object
  extended by railo.commons.lang.ByteBuffer

public class ByteBuffer
extends Object

class to handle characters, similar to StringBuffer, but dont copy big blocks of char arrays.


Constructor Summary
ByteBuffer(String charset)
          default constructor
ByteBuffer(String charset, int size)
          constructor with size of the buffer
 
Method Summary
 void append(byte[] c)
           
 void append(char c)
           
 void append(char[] c)
          method to appennd a charr array to the buffer
 void append(char[] c, int off, int len)
          method to append a part of a char array
 void append(String str)
          Method to append a string to char buffer
 void append(String str, int off, int len)
          method to append a part of a String
 void clear()
          clear the content of the buffer
 byte[] getBytes()
           
static void main(String[] args)
           
 int size()
           
 String toString()
           
 void writeOut(OutputStream os)
          method to writeout content of the char buffer in a writer, this is faster than get char array with (toCharArray()) and write this in writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteBuffer

public ByteBuffer(String charset)
default constructor


ByteBuffer

public ByteBuffer(String charset,
                  int size)
constructor with size of the buffer

Parameters:
size -
Method Detail

append

public void append(char c)
            throws IOException
Throws:
IOException

append

public void append(char[] c)
            throws IOException
method to appennd a charr array to the buffer

Parameters:
c - char array to append
Throws:
IOException

append

public void append(byte[] c)

append

public void append(char[] c,
                   int off,
                   int len)
            throws IOException
method to append a part of a char array

Parameters:
c - char array to get part from
off - start index on the char array
len - length of the sequenz to get from array
Throws:
IOException

append

public void append(String str)
            throws IOException
Method to append a string to char buffer

Parameters:
str - String to append
Throws:
IOException

append

public void append(String str,
                   int off,
                   int len)
            throws IOException
method to append a part of a String

Parameters:
str - string to get part from
off - start index on the string
len - length of the sequenz to get from string
Throws:
IOException

writeOut

public void writeOut(OutputStream os)
              throws IOException
method to writeout content of the char buffer in a writer, this is faster than get char array with (toCharArray()) and write this in writer.

Parameters:
writer - writer to write inside
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

clear

public void clear()
clear the content of the buffer


size

public int size()
Returns:
returns the size of the content of the buffer

getBytes

public byte[] getBytes()

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2012 Railo