|
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.AgoByteStore
An abstract base class for a set of classes that store a sequence of bytes.
These classes are usually used to store and retrieve content in MIME parts that store byte information
(the subclasses of AgoMIMEPartByteStream
).
Constructor Summary | |
AgoByteStore()
|
Method Summary | |
void |
append(AgoByteStore store)
Appends another byte to this store. |
abstract void |
append(InputStream stream)
Appends an InputStream to the store. |
abstract void |
append(int value)
Appends a byte to the store. |
abstract AgoBufferingInputStream |
getInputStream()
Obtains an input stream for reading this byte store. |
int |
getOffset()
Gets the current offset into this byte store. |
void |
incrementOffset()
Increments the current offset by 1 (one) byte. |
abstract int |
length()
Returns the length of data 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 byte from the current offset in the byte store, without consuming it. |
abstract int |
read()
Reads a byte from the input stream or byte store and advances the offset one byte. |
abstract void |
reset()
Removes all contents of this store. |
void |
setOffset(int offset)
Sets the current offset into the byte store. |
abstract String |
toString()
For the AgoByteStore class, converts the byte store to a String. |
void |
write(OutputStream outputstream,
AgoEncodingIdentifier encodingidentifier)
Writes to the specified output stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AgoByteStore()
Method Detail |
public abstract int read() throws IOException
int i = byteStore.read();
AgoByteStore.peek()
,
AgoByteStore.peek( int nth )
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, the read()
method does.
int i = byteStore.peek();
AgoByteStore.read()
,
AgoByteStore.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 = byteStore.peek(1);
AgoByteStore.read()
,
AgoByteStore.peek()
public abstract void append(int value) throws IOException
value
- the byte to append.byteStore.append(23);
public void append(AgoByteStore store) throws IOException
store
- the AgoByteStore to append.byteStore.append(someAgoByteStore);
public abstract void append(InputStream stream) throws IOException
stream
- the InputStream to append.byteStore.append(someInputStream);
public abstract void reset()
byteStore.reset();
public abstract int length() throws IOException
int i = byteStore.length();
public int getOffset()
int i = byteStore.getOffset();
AgoByteStore.setOffset( int offset )
,
AgoByteStore.incrementOffset()
,
AgoByteStore.read()
,
AgoByteStore.peek()
public void setOffset(int offset)
offset
- specifies the offset amount in bytesbyteStore.setOffset(1);
AgoByteStore.getOffset()
,
AgoByteStore.incrementOffset()
public void incrementOffset()
byteStore.incrementOffset();
AgoByteStore.getOffset()
,
AgoByteStore.setOffset( int offset )
public abstract AgoBufferingInputStream getInputStream() throws IOException
AgoBufferingInputStream in = byteStore.getInputStream();
AgoBufferingInputStream
public void write(OutputStream outputstream, AgoEncodingIdentifier encodingidentifier) throws IOException
outputstream
- specifies the output stream.encodingidentifier
- specifies the encoding mechanism to use.
See AgoMIME
for a list of supported encoding mechanisms.byteStore.write(someOutputStream, "base64");
AgoByteStore.read()
,
AgoEncodingIdentifier
public abstract String toString()
String str = byteStore.toString();
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |