|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.monica.javacom.streams.MJCReaderIsAIS
Class for enabling to read from the MJC layer hierarchy using the conventional InputStream methods. Objects of this class act as InputStreams, they read the data from their MJCReadable.
Constructor Summary | |
MJCReaderIsAIS()
Default constructor. |
Method Summary | |
int |
available()
Returns the number of bytes that are currently available for reading from the stream. |
void |
close()
Closes the InputStream. |
void |
connectionClosedEvent(MJCReadable readable)
Handles the asynchronous connectionClosedEvents from the MJCReadable. |
void |
errorEvent(java.lang.String errorDescription,
MJCReadable readable)
Handles the asynchronous errorEvents from the MJCReadable. |
MJCReadable |
getReadable()
Queries the MJCReadable from which data will be read. |
java.lang.String |
getReaderName()
Returns the MJC name of the MJCReader. |
java.lang.String |
getReaderVersion()
Returns the MJC version of the MJCReader. |
void |
mark(int readlimit)
MJCReaderIsAIS does not support mark/reset. |
boolean |
markSupported()
MJCReaderIsAIS does not support mark/reset. |
int |
read()
Reads 1 single byte from the stream. |
int |
read(byte[] b)
Reads b.length bytes from the stream. |
int |
read(byte[] b,
int off,
int len)
Reads len bytes from the stream. |
void |
readEvent(MJCReadable readable)
Handles the asynchronous readEvents from the MJCReadable. |
void |
reset()
MJCReaderIsAIS does not support mark/reset. |
void |
setReadable(MJCReadable readable)
Sets the MJCReadable from which data ha to be read, this means which will send the readEvents. |
long |
skip(long n)
Skips n bytes in the stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MJCReaderIsAIS()
Method Detail |
public java.lang.String getReaderName()
getReaderName
in interface MJCReader
public java.lang.String getReaderVersion()
getReaderVersion
in interface MJCReader
public void readEvent(MJCReadable readable)
readEvent
in interface MJCReader
MJCReadable
- readable: the MJCReadable from which the
readEvent camepublic void connectionClosedEvent(MJCReadable readable)
connectionClosedEvent
in interface MJCReader
MJCReadable
- readable: the MJCReadable from which
the connectionClosedEvent camepublic void errorEvent(java.lang.String errorDescription, MJCReadable readable)
errorEvent
in interface MJCReader
String
- errorDescription: the error messageMJCReadable
- readable: the MJCReadable from which
the connectionClosedEvent camepublic void setReadable(MJCReadable readable)
setReadable
in interface MJCReader
MJCReadable
- readable: the MJCReadable from which data
has to be readpublic MJCReadable getReadable()
getReadable
in interface MJCReader
public int read() throws java.io.IOException
read
in class java.io.InputStream
IOException:
- if the InputStream has been closedpublic int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
byte[]
- b: the byte array into the data will be readIOException:
- if the InputStream has been closedpublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
byte[]
- b: the byte array into the data will be readint
- off: the beginning offset from which the bytes will
be written into b (inclusive)int
- len: the number of bytes to be readIOException:
- if the InputStream has been closedIndexOutOfBoundsException:
- if (b.length<(off+len))public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
long
- n: number of bytes to be skippedIOException:
- if the InputStream has been closedpublic int available() throws java.io.IOException
available
in class java.io.InputStream
IOException:
- if the InputStream has been closedpublic void close() throws java.io.IOException
close
in class java.io.InputStream
IOException:
- if the InputStream has been closedpublic void mark(int readlimit)
mark
in class java.io.InputStream
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
IOException:
- MJCReaderIsAIS does not support mark/resetpublic boolean markSupported()
markSupported
in class java.io.InputStream
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |