Package com.streamconverter.command.impl
Class SampleStreamCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.command.impl.SampleStreamCommand
- All Implemented Interfaces:
IStreamCommand
SampleStreamCommand is a concrete implementation of AbstractStreamCommand.
This command reads data from an input stream and writes it to an output stream.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that initializes the command with a default ID.Constructor that initializes the command with a specific ID. -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeInternal
(InputStream inputStream, OutputStream outputStream) Executes the command on the provided input stream and writes the result to the output stream.toString()
Methods inherited from class com.streamconverter.command.AbstractStreamCommand
execute, getCommandDetails
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.streamconverter.command.IStreamCommand
execute
-
Constructor Details
-
SampleStreamCommand
public SampleStreamCommand()Default constructor that initializes the command with a default ID. -
SampleStreamCommand
Constructor that initializes the command with a specific ID.- Parameters:
arg
- The ID to be assigned to this command.- Throws:
NullPointerException
- if arg is null
-
-
Method Details
-
executeInternal
Executes the command on the provided input stream and writes the result to the output stream.- Specified by:
executeInternal
in classAbstractStreamCommand
- Parameters:
inputStream
- The input stream to read data from.outputStream
- The output stream to write data to.- Throws:
IOException
- If an I/O error occurs during the execution of the command.
-
toString
-