Package ej.event

Class EventQueueDataReader

  • All Implemented Interfaces:
    EventDataReader

    public class EventQueueDataReader
    extends java.lang.Object
    implements EventDataReader
    EventQueueDataReader is an implementation of the EventDataReader interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      Returns the number of bytes that can be read (or skipped over).
      int read​(byte[] b, int off, int len)
      Reads len bytes of data and store them into the buffer b.
      boolean readBoolean()
      Reads the next boolean of data.
      byte readByte()
      Reads the next byte of data.
      char readChar()
      Reads the next char of data.
      double readDouble()
      Reads the next double of data.
      float readFloat()
      Reads the next float of data.
      int readFully​(byte[] b)
      Reads all the bytes of data and store them into the buffer b.
      int readInt()
      Reads the next integer of data.
      long readLong()
      Reads the next long of data.
      short readShort()
      Reads the next short of data.
      int readUnsignedByte()
      Reads the next unsigned byte of data.
      int readUnsignedShort()
      Reads the next unsigned short of data.
      int skipBytes​(int n)
      Skips over and discard n bytes of data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventQueueDataReader

        public EventQueueDataReader()
    • Method Detail

      • readBoolean

        public boolean readBoolean()
                            throws java.io.IOException
        Description copied from interface: EventDataReader
        Reads the next boolean of data.
        Specified by:
        readBoolean in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next byte of data.
        Specified by:
        readByte in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next char of data.
        Specified by:
        readChar in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next double of data.
        Specified by:
        readDouble in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next float of data.
        Specified by:
        readFloat in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads all the bytes of data and store them into the buffer b.
        Specified by:
        readFully in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads len bytes of data and store them into the buffer b.
        Specified by:
        read in interface EventDataReader
        Parameters:
        b - the buffer into which the data is read.
        off - the start offset in the buffer b at 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.IOException
        Description copied from interface: EventDataReader
        Reads the next integer of data.
        Specified by:
        readInt in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next long of data.
        Specified by:
        readLong in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next short of data.
        Specified by:
        readShort in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next unsigned byte of data.
        Specified by:
        readUnsignedByte in interface EventDataReader
        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.IOException
        Description copied from interface: EventDataReader
        Reads the next unsigned short of data.
        Specified by:
        readUnsignedShort in interface EventDataReader
        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: EventDataReader
        Skips over and discard n bytes of data.
        Specified by:
        skipBytes in interface EventDataReader
        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: EventDataReader
        Returns the number of bytes that can be read (or skipped over).
        Specified by:
        available in interface EventDataReader
        Returns:
        the number of available data bytes.