Package ej.rcommand
Interface CommandReader
-
- All Known Subinterfaces:
RemoteConnection
- All Known Implementing Classes:
DynamicRemoteConnection,SocketRemoteConnection,StreamRemoteConnection
public interface CommandReader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanreadBoolean()Reads a boolean parameter.byte[]readByteArray()Reads a byte array parameter.StringreadCommand()Reads a command.doublereadDouble()Reads a double parameter.floatreadFloat()Reads a float parameter.InputStreamreadInputStream()Reads an input stream.intreadInt()Reads an integer parameter.longreadLong()Reads a long parameter.ObjectreadObject()Reads a parameter, whatever it's type.StringreadString()Reads a string parameter.voidskipParameters()Skips the parameters of a command and get ready to read the following command.
-
-
-
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 IOExceptionReads 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 IOExceptionReads 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 IOExceptionReads 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 IOExceptionReads 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 IOExceptionReads 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 IOExceptionReads 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 IOExceptionSkips the parameters of a command and get ready to read the following command.- Throws:
IOException
-
-