public class CharBuffer extends Object
Constructor and Description |
---|
CharBuffer()
default constructor
|
CharBuffer(int size)
constructor with size of the buffer
|
Modifier and Type | Method and Description |
---|---|
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(String characterEncoding) |
int |
size() |
char[] |
toCharArray()
return content of the Char Buffer as char array
|
String |
toString() |
void |
writeOut(OutputStream os,
String charset) |
void |
writeOut(Writer writer)
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.
|
public CharBuffer()
public CharBuffer(int size)
size
- public void append(char c)
public void append(char[] c)
c
- char array to appendpublic void append(char[] c, int off, int len)
c
- char array to get part fromoff
- start index on the char arraylen
- length of the sequenz to get from arraypublic void append(String str)
str
- String to appendpublic void append(String str, int off, int len)
str
- string to get part fromoff
- start index on the stringlen
- length of the sequenz to get from stringpublic void writeOut(Writer writer) throws IOException
writer
- writer to write insideIOException
public void writeOut(OutputStream os, String charset) throws IOException
IOException
public char[] toCharArray()
public void clear()
public int size()
public byte[] getBytes(String characterEncoding) throws UnsupportedEncodingException
UnsupportedEncodingException
Copyright © 2015 Lucee