Class ByteTraciWriter
- java.lang.Object
-
- org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter<Integer>
-
- org.eclipse.mosaic.fed.sumo.bridge.traci.writer.ByteTraciWriter
-
public class ByteTraciWriter extends AbstractTraciParameterWriter<Integer>
-
-
Field Summary
-
Fields inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter
value
-
-
Constructor Summary
Constructors Constructor Description ByteTraciWriter()
ByteTraciWriter(int value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getVariableLength(Integer argument)
If the value of the parameter has a variable length depending on its actual value (e.g.void
write(DataOutputStream out)
Writes the predefined, constant command parameter value to the givenDataOutputStream
.void
writeVariableArgument(DataOutputStream out, Integer argument)
Writes the given variable command parameter value to the givenDataOutputStream
.-
Methods inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter
getLength, isVariable
-
-
-
-
Method Detail
-
getVariableLength
public int getVariableLength(Integer argument)
Description copied from class:AbstractTraciParameterWriter
If the value of the parameter has a variable length depending on its actual value (e.g. Strings), then this method must return the length in bytes based on the given argument.- Specified by:
getVariableLength
in classAbstractTraciParameterWriter<Integer>
- Parameters:
argument
- the argument to calculate the length in bytes from.- Returns:
- the length in bytes of this command parameter.
-
write
public void write(DataOutputStream out) throws IOException
Description copied from class:AbstractTraciParameterWriter
Writes the predefined, constant command parameter value to the givenDataOutputStream
.- Specified by:
write
in classAbstractTraciParameterWriter<Integer>
- Parameters:
out
- theDataOutputStream
to write the actual bytes to- Throws:
IOException
- if something went wrong during writing
-
writeVariableArgument
public void writeVariableArgument(DataOutputStream out, Integer argument) throws IOException
Description copied from class:AbstractTraciParameterWriter
Writes the given variable command parameter value to the givenDataOutputStream
.- Specified by:
writeVariableArgument
in classAbstractTraciParameterWriter<Integer>
- Parameters:
out
- theDataOutputStream
to write the actual bytes toargument
- the actual value to write to theDataOutputStream
- Throws:
IOException
- if something went wrong during writing
-
-