|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.srv.mail.AgoCharStore
Abstract base class for all character stores. A character store stores a stream of characters.
Constructor Summary | |
AgoCharStore()
|
Method Summary | |
void |
append(AgoCharStore store)
Appends an AgoCharStore to the store. |
abstract void |
append(char[] buf,
int offset,
int length)
appends a segment of a character buffer to the store. |
abstract void |
append(int value)
Appends a character to the store. |
abstract void |
append(Reader reader)
Appends a character stream to the store. |
abstract void |
append(String string)
Appends a String to the store. |
int |
getOffset()
Gets the current offset into this character or store. |
abstract AgoBufferingReader |
getReader()
Returns an AgoBufferingReader on this character store. |
void |
incrementOffset()
Increments the current offset by 1 (one) character. |
abstract int |
length()
Returns the length of data (number of characters) currently in this store. |
abstract int |
peek()
Peeks at the next byte in the character or byte store witout advancing the offset. |
abstract int |
peek(int nth)
Returns the nth next character from the current offset in the character store, without consuming it. |
abstract int |
read()
Reads a character from the store and advances the offset one character. |
abstract void |
reset()
Removes all contents of this store. |
void |
setOffset(int offset)
Sets the current offset into the character store. |
abstract String |
toString()
For the AgoCharStore class, converts the character store to a String. |
void |
write(OutputStream outputstream,
AgoCharSetIdentifier charsetidentifier,
AgoEncodingIdentifier encodingidentifier)
Writes this character store to the specified output stream using a specific character set and encoding identifier. |
abstract void |
write(Writer writer)
Writes the character store to the specified Writer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AgoCharStore()
Method Detail |
public abstract int read() throws IOException
int i = charStore.read();
AgoCharStore.peek()
public abstract int peek() throws IOException
The read()
method can then be used to read the byte. This is shorthand for peek()
.
The peek()
method does not move the offset, while the read()
method does.
int i = charStore.peek();
AgoCharStore.read()
,
AgoCharStore.peek( int nth )
public abstract int peek(int nth) throws IOException
nth
- specifies the byte to peek at. It is zero-based, 0 is the next byte.
The nth parameter is zero-based. If the value of nth is 0, the next byte is returned.
If the value of nth is 1, the second byte is returned, etc.
The read()
method can then be used to read the byte. The peek()
method does not move the offset; the read()
method does.
int i = charStore.peek(1);
AgoCharStore.read()
,
AgoCharStore.peek()
public abstract void append(int value) throws IOException
value
- the character to append.charStore.append('b');
AgoCharStore.append( String string )
,
AgoCharStore.append( char[] buf, int offset, int length )
,
AgoCharStore.append( AgoCharStore store )
,
AgoCharStore.append( Reader reader )
public abstract void append(String string) throws IOException
string
- specifies the String to append.
Note that append()
is an overloaded method. Use this version to append a
String. The other versions provide the ability to append other data or object types.
charStore.append("Hello World!");
AgoCharStore.append( int value )
,
AgoCharStore.append( char[] buf, int offset, int length )
,
AgoCharStore.append( AgoCharStore store )
,
AgoCharStore.append( Reader reader )
public abstract void append(char[] buf, int offset, int length) throws IOException
buf
- specifies the character buffer to read from.offset
- specifies the offset of the character buffer to start reading from.length
- specifies the number of characters to read fromthe character buffer.
Note that append()
is an overloaded method. Use this version to append a
segment of a character buffer. The other versions provide the ability to append other object
or data types.
char[] buf; charStore.append(buf, 0, buf.length);
AgoCharStore.append( int value )
,
AgoCharStore.append( String string )
,
AgoCharStore.append( AgoCharStore store )
,
AgoCharStore.append( Reader reader )
public void append(AgoCharStore store) throws IOException
store
- the AgoCharStore to append.
Note that append()
is an overloaded method. Use this version to append an
AgoCharStore. The other versions provide the ability to append other object or data types.
charStore.append(someAgoCharStore);
AgoCharStore.append( int value )
,
AgoCharStore.append( String string )
,
AgoCharStore.append( char[] buf, int offset, int length )
,
AgoCharStore.append( Reader reader )
public abstract void append(Reader reader) throws IOException
reader
- specifies the Reader to append.
Note that append()
is an overloaded method. Use this version to append a
Reader. The other versions provide the ability to append other data or object types.
charStore.append(someReader);
AgoCharStore.append( int value )
,
AgoCharStore.append( String string )
,
AgoCharStore.append( char[] buf, int offset, int length )
,
AgoCharStore.append( AgoCharStore store )
public abstract void reset()
charStore.reset();
public abstract int length() throws IOException
int i = charStore.length();
public int getOffset()
int i = charStore.getOffset();
AgoCharStore.setOffset( int offset )
,
AgoCharStore.incrementOffset()
,
AgoCharStore.read()
,
AgoCharStore.peek()
public void setOffset(int offset)
offset
- specifies the offset amount in characterscharStore.setOffset(1);
AgoCharStore.getOffset()
,
AgoCharStore.incrementOffset()
public void incrementOffset()
charStore.incrementOffset();
AgoCharStore.getOffset()
,
AgoCharStore.setOffset( int offset)
public abstract String toString()
String str = charStore.toString();
public abstract AgoBufferingReader getReader() throws IOException
AgoBufferingReader reader = charStore.getReader();
public abstract void write(Writer writer) throws IOException
writer
- specifies the writer.charStore.write(someWriter);
AgoCharStore.read()
,
AgoCharStore.write( OutputStream outputstream,
AgoCharSetIdentifier charsetidentifier,
AgoEncodingIdentifier encodingidentifier )
public void write(OutputStream outputstream, AgoCharSetIdentifier charsetidentifier, AgoEncodingIdentifier encodingidentifier) throws IOException
outputstream
- specifies the output stream.charsetidentifier
- specifies the character set to use.
See AgoMIME
for a list of valid character set constants.encodingidentifier
- specifies the encoding mechanism to use.
See AgoMIME
for a list of valid encoding mechanism constants.charStore.write(someOutputStream, "iso-8859-1", "quoted-printable");
AgoCharStore.read()
,
AgoCharStore.write( Writer writer )
,
AgoEncodingIdentifier
,
AgoCharSetIdentifier
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |