|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscone.util.tokenstream.TokenOutputStream
public class TokenOutputStream
writes Tokens into a TokenBuffer
| Constructor Summary | |
|---|---|
TokenOutputStream()
creates a new TokenOutputStream with a standard size TokenBuffer. |
|
| Method Summary | |
|---|---|
void |
close()
Close the token output stream. |
static TokenOutputStream |
create(RequestEvent e)
Returns a TokenOutputStream that allows to pass tokens to the next MEG. |
void |
flush()
Flush the stream. |
protected java.lang.Object |
getBufferContext()
Get the buffer context. |
MegObject |
getClone()
returns a copy of this MegObject to preserve the data in its original state. |
java.io.InputStream |
getInputStream()
provides interoperation with "old" MEGs that do not understand the MegObject and must process the data as a MegInputStream. |
java.util.Hashtable |
getMetaInfo()
|
java.io.Reader |
getReader()
getReader provides access to the MegObject as character data rather than bytes. |
java.io.Reader |
getReader(java.lang.String encoding)
getReader provides access to the MegObject as character data using the specified character encoding. |
long |
getTimeout()
Access the timeout value for write operations. |
boolean |
isClosed()
Determine if the stream is closed. |
protected void |
setMetaInfo(java.util.Hashtable metaInfo)
|
void |
setTimeout(long timeout)
Set a timeout value for write operations. |
void |
write(Token token)
Write a Token to the stream. |
void |
write(Token[] buf)
Write a Token array to the stream. |
void |
write(Token[] buf,
int offset,
int length)
Write a portion of the passed Token buffer array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TokenOutputStream()
| Method Detail |
|---|
public static TokenOutputStream create(RequestEvent e)
throws java.lang.Exception
e - the RequestEvent
java.lang.Exceptionpublic java.io.InputStream getInputStream()
public java.io.Reader getReader()
throws java.io.UnsupportedEncodingException,
NotCharDataException
java.io.UnsupportedEncodingException
NotCharDataException
public java.io.Reader getReader(java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
NotCharDataException
encoding - the desired character encoding.
java.io.UnsupportedEncodingException
NotCharDataExceptionpublic MegObject getClone()
public void write(Token[] buf,
int offset,
int length)
throws java.io.IOException
buf - The Token buffer array.offset - Offset in the array to start writing from.length - The amount from offset to write.
java.io.IOException - If unable to write to stream.
public void write(Token token)
throws java.io.IOException
token - the Token to write.
java.io.IOException - If unable to write to stream.
public void write(Token[] buf)
throws java.io.IOException
buf - The Token array to write.
java.io.IOException - If unable to write to stream.public void setTimeout(long timeout)
timeout - The maximum time to block for write operations, in milliseconds.
A value of zero (the default) means to never timeout.public long getTimeout()
public void close()
throws java.io.IOException
java.io.IOException - If error occurred closing stream.public boolean isClosed()
true if closed.
public void flush()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.Object getBufferContext()
public java.util.Hashtable getMetaInfo()
protected void setMetaInfo(java.util.Hashtable metaInfo)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||