Package ej.rcommand

Interface CommandReader

    • Method Detail

      • readCommand

        String readCommand()
                    throws IOException
        Reads a command.
        Returns:
        the command name.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readString

        String readString()
                   throws IOException
        Reads a string parameter.
        Returns:
        the read string.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readLong

        long readLong()
               throws IOException
        Reads a long parameter.
        Returns:
        the read long.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readInt

        int readInt()
             throws IOException
        Reads an integer parameter.
        Returns:
        the read integer.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readFloat

        float readFloat()
                 throws IOException
        Reads a float parameter.
        Returns:
        the read float.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readDouble

        double readDouble()
                   throws IOException
        Reads a double parameter.
        Returns:
        the read double.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readBoolean

        boolean readBoolean()
                     throws IOException
        Reads a boolean parameter.
        Returns:
        the read boolean.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readByteArray

        byte[] readByteArray()
                      throws IOException
        Reads a byte array parameter.
        Returns:
        the read byte array.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readInputStream

        InputStream readInputStream()
                             throws IOException
        Reads an input stream.

        The returned input stream must be fully read before returning the method.

        Returns:
        an inputStream.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • readObject

        Object readObject()
                   throws IOException
        Reads a parameter, whatever it's type. Note that if the parameter is a byte array, it will be returned as an InputStream that must be completely consumed before reading the next parameter.
        Returns:
        an object reflecting the read parameter.
        Throws:
        IOException - the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
      • skipParameters

        void skipParameters()
                     throws IOException
        Skips the parameters of a command and get ready to read the following command.
        Throws:
        IOException