Package ej.rcommand
Interface CommandSender
-
- All Known Subinterfaces:
RemoteConnection
- All Known Implementing Classes:
DynamicRemoteConnection,SocketRemoteConnection,StreamRemoteConnection
public interface CommandSender
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidflushCommand()Ends the command frame.InputStreamgetInputStream()Get the InputStream used by the instance.OutputStreamgetOutputStream()Get the OuputStream used by the instance.voidsendBoolean(boolean b)Sends a boolean parameter.voidsendByteArray(byte[] a)Sends a byte array parameter.voidsendByteArray(byte[] buffer, int offset, int length)Sends a byte array parameter with offset and length.voidsendDouble(double d)Sends a double parameter.voidsendFloat(float f)Sends a float parameter.voidsendInputStream(InputStream is)Sends an input stream.voidsendInt(int i)Sends an integer parameter.voidsendLong(long l)Sends a long parameter.voidsendString(String string)Sends a string parameter.voidstartCommand(String command)Starts a command.
-
-
-
Method Detail
-
startCommand
void startCommand(String command)
Starts a command.A command can be followed by arguments.
- Parameters:
command- the command name.
-
sendString
void sendString(String string)
Sends a string parameter.- Parameters:
string- the string to send.
-
sendLong
void sendLong(long l)
Sends a long parameter.- Parameters:
l- the long to send.
-
sendInt
void sendInt(int i)
Sends an integer parameter.- Parameters:
i- the integer to send.
-
sendFloat
void sendFloat(float f)
Sends a float parameter.- Parameters:
f- the float to send.
-
sendDouble
void sendDouble(double d)
Sends a double parameter.- Parameters:
d- the double to send.
-
sendBoolean
void sendBoolean(boolean b)
Sends a boolean parameter.- Parameters:
b- the boolean to send.
-
sendByteArray
void sendByteArray(byte[] a)
Sends a byte array parameter.- Parameters:
a- the byte array to send.
-
sendByteArray
void sendByteArray(byte[] buffer, int offset, int length)Sends a byte array parameter with offset and length.- Parameters:
buffer- the byte array to send.offset- offset in the byte array.length- data length to send.
-
sendInputStream
void sendInputStream(InputStream is)
Sends an input stream.- Parameters:
is- the input stream to send.
-
flushCommand
void flushCommand()
Ends the command frame.
-
getOutputStream
@Nullable OutputStream getOutputStream()
Get the OuputStream used by the instance.- Returns:
- the OuputStream used by the instance, or
nullif this command sender is not ready to send a command.
-
getInputStream
@Nullable InputStream getInputStream()
Get the InputStream used by the instance.- Returns:
- the InputStream used by the instance, or
nullif this command sender is not ready to send a command.
-
-