Package ej.event
Class EventQueueDataReader
- java.lang.Object
-
- ej.event.EventQueueDataReader
-
- All Implemented Interfaces:
EventDataReader
public class EventQueueDataReader extends java.lang.Object implements EventDataReader
EventQueueDataReader is an implementation of the EventDataReader interface.
-
-
Constructor Summary
Constructors Constructor Description EventQueueDataReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()Returns the number of bytes that can be read (or skipped over).intread(byte[] b, int off, int len)Readslenbytes of data and store them into the bufferb.booleanreadBoolean()Reads the next boolean of data.bytereadByte()Reads the next byte of data.charreadChar()Reads the next char of data.doublereadDouble()Reads the next double of data.floatreadFloat()Reads the next float of data.intreadFully(byte[] b)Reads all the bytes of data and store them into the bufferb.intreadInt()Reads the next integer of data.longreadLong()Reads the next long of data.shortreadShort()Reads the next short of data.intreadUnsignedByte()Reads the next unsigned byte of data.intreadUnsignedShort()Reads the next unsigned short of data.intskipBytes(int n)Skips over and discardnbytes of data.
-
-
-
Method Detail
-
readBoolean
public boolean readBoolean() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next boolean of data.- Specified by:
readBooleanin interfaceEventDataReader- Returns:
- the next boolean of data.
- Throws:
java.io.IOException- if there is no boolean remaining in the data of the extended event.
-
readByte
public byte readByte() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next byte of data.- Specified by:
readBytein interfaceEventDataReader- Returns:
- the next byte of data.
- Throws:
java.io.IOException- if there is no byte remaining in the data of the extended event.
-
readChar
public char readChar() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next char of data.- Specified by:
readCharin interfaceEventDataReader- Returns:
- the next char of data.
- Throws:
java.io.IOException- if there is no char remaining in the data of the extended event.
-
readDouble
public double readDouble() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next double of data.- Specified by:
readDoublein interfaceEventDataReader- Returns:
- the next double of data.
- Throws:
java.io.IOException- if there is no double remaining in the data of the extended event.
-
readFloat
public float readFloat() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next float of data.- Specified by:
readFloatin interfaceEventDataReader- Returns:
- the next float of data.
- Throws:
java.io.IOException- if there is no float remaining in the data of the extended event.
-
readFully
public int readFully(byte[] b) throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads all the bytes of data and store them into the bufferb.- Specified by:
readFullyin interfaceEventDataReader- Parameters:
b- the buffer into which the data is read.- Returns:
- the total number of bytes read into the buffer.
- Throws:
java.io.IOException- if there is no byte remaining in the data of the extended event or if the buffer is too small to store the event data.
-
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionDescription copied from interface:EventDataReaderReadslenbytes of data and store them into the bufferb.- Specified by:
readin interfaceEventDataReader- Parameters:
b- the buffer into which the data is read.off- the start offset in the bufferbat which the data is written.len- the number of bytes to read.- Returns:
- the total number of bytes read into the buffer.
- Throws:
java.io.IOException- if there are not enough bytes remaining in the data of the extended event or if the buffer is too small to store the event data.
-
readInt
public int readInt() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next integer of data.- Specified by:
readIntin interfaceEventDataReader- Returns:
- the next integer of data.
- Throws:
java.io.IOException- if there is no integer remaining in the data of the extended event.
-
readLong
public long readLong() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next long of data.- Specified by:
readLongin interfaceEventDataReader- Returns:
- the next long of data.
- Throws:
java.io.IOException- if there is no long remaining in the data of the extended event.
-
readShort
public short readShort() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next short of data.- Specified by:
readShortin interfaceEventDataReader- Returns:
- the next short of data.
- Throws:
java.io.IOException- if there is no short remaining in the data of the extended event.
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next unsigned byte of data.- Specified by:
readUnsignedBytein interfaceEventDataReader- Returns:
- the next unsigned byte of data.
- Throws:
java.io.IOException- if there is no unsigned byte remaining in the data of the extended event.
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOExceptionDescription copied from interface:EventDataReaderReads the next unsigned short of data.- Specified by:
readUnsignedShortin interfaceEventDataReader- Returns:
- the next unsigned short of data.
- Throws:
java.io.IOException- if there is no unsigned short remaining in the data of the extended event.
-
skipBytes
public int skipBytes(int n)
Description copied from interface:EventDataReaderSkips over and discardnbytes of data.- Specified by:
skipBytesin interfaceEventDataReader- Parameters:
n- the number of bytes to skip.- Returns:
- 0 if OK and -1 if an error occurs.
-
available
public int available()
Description copied from interface:EventDataReaderReturns the number of bytes that can be read (or skipped over).- Specified by:
availablein interfaceEventDataReader- Returns:
- the number of available data bytes.
-
-