|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.fw.util.EboCharBuffer
EboCharBuffer is a wrapper class around a char array. A EboCharBuffer API allows reads and writes without worrying about underlying char array. This class is intended to be used as the underlying storage mechanism for pair(s) of Reader/Writer classes that can attach/detach its underlying storage facility. Please note, this class is not synchronized. It is up to the user of this storage facility to handle synchronization.
Constructor Summary | |
EboCharBuffer()
Creates a EboCharBuffer with the default byte array size and chunk count |
|
EboCharBuffer(char[] buf)
Creates a EboCharBuffer from the specified array of chars. |
|
EboCharBuffer(char[] buf,
int inuse)
Creates a EboCharBuffer from the specified array of chars. |
|
EboCharBuffer(int size)
Creates a EboCharBuffer with the specified byte array size Will also grow by this size. |
|
EboCharBuffer(Reader in)
Creates a EboCharBuffer from the contents of the specified Reader with the default byte array size |
|
EboCharBuffer(Reader in,
int incr)
Creates a EboCharBuffer from the contents of the specified Reader. |
|
EboCharBuffer(String s)
Creates a EboCharBuffer from the specified string |
Method Summary | |
int |
available()
Get the size of the available buffer space. |
String |
getEncoding()
Return a character string representing the encoding of the characters in this buffer. |
int |
getPosition()
Returns the current position. |
int |
read()
Read the next char from the buffer. |
int |
read(char[] buf,
int offset,
int len)
Read a stream of chars until the specified output array is full. |
void |
reset()
Re-set the buffer to the empty state. |
void |
resetPos()
Reset the cursor to start of buffer for reading |
boolean |
seek(int desiredPosition)
Move the cursor position. |
int |
size()
Get the current size of the buffer that is in use. |
long |
skip(long skipCnt)
Move the cursor position forward by specified number of chars. |
char[] |
toCharArray()
Get a copy of the in use portion of the buffer as a char array |
String |
toString()
Get the char array as a String |
void |
write(char[] chars,
int offset,
int len)
Write the specified number of chars to the buffer. |
void |
write(int b)
Write the specified char to the buffer. |
void |
writeTo(Writer out)
Writes the complete contents of this char buffer to the specified output writer argument. |
int |
writeTo(Writer out,
int len)
Write up to n characters starting at the current read position to the specified Writer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public EboCharBuffer()
public EboCharBuffer(int size)
size
- the initial buffer sizepublic EboCharBuffer(char[] buf)
buf
- the input buffer (not copied)public EboCharBuffer(char[] buf, int inuse)
buf
- the input bufferinuse
- number of chars used in input bufferpublic EboCharBuffer(String s)
s
- the string valuepublic EboCharBuffer(Reader in, int incr) throws com.sssw.fw.util.IOException
in
- The Reader used to initialize the EboCharBufferincr
- An int increment size to grow buffer when neededpublic EboCharBuffer(Reader in) throws com.sssw.fw.util.IOException
in
- The Reader used to initialize the EboCharBufferMethod Detail |
public void resetPos()
public char[] toCharArray()
public String toString()
public int available()
public int size()
public void reset()
public String getEncoding()
public int read()
public int read(char[] buf, int offset, int len)
buf
- output char arrayoffset
- starting index to use in the output arraylen
- the number of chars to readpublic long skip(long skipCnt)
skipCnt
- requested number of chars to skippublic final boolean seek(int desiredPosition)
desiredPosition
- requested position.public final int getPosition()
public void write(int b)
b
- the char to write to bufferpublic void write(char[] chars, int offset, int len)
b
- char array containing chars to be written to bufferoffset
- starting offset in the input char array to uselen
- number of chars to be writtenpublic void writeTo(Writer out) throws com.sssw.fw.util.IOException
out
- the writer to write to.public int writeTo(Writer out, int len) throws com.sssw.fw.util.IOException
out
- the writer to write to.len
- the number of characters to write
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |