Class ByteTraciWriter
java.lang.Object
org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter<Integer>
org.eclipse.mosaic.fed.sumo.bridge.traci.writer.ByteTraciWriter
-
Field Summary
Fields inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.writer.AbstractTraciParameterWriter
value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetVariableLength(Integer argument) If the value of the parameter has a variable length depending on its actual value (e.g.voidwrite(DataOutputStream out) Writes the predefined, constant command parameter value to the givenDataOutputStream.voidwriteVariableArgument(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
-
Constructor Details
-
ByteTraciWriter
public ByteTraciWriter() -
ByteTraciWriter
public ByteTraciWriter(int value)
-
-
Method Details
-
getVariableLength
Description copied from class:AbstractTraciParameterWriterIf 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:
getVariableLengthin classAbstractTraciParameterWriter<Integer>- Parameters:
argument- the argument to calculate the length in bytes from.- Returns:
- the length in bytes of this command parameter.
-
write
Description copied from class:AbstractTraciParameterWriterWrites the predefined, constant command parameter value to the givenDataOutputStream.- Specified by:
writein classAbstractTraciParameterWriter<Integer>- Parameters:
out- theDataOutputStreamto write the actual bytes to- Throws:
IOException- if something went wrong during writing
-
writeVariableArgument
Description copied from class:AbstractTraciParameterWriterWrites the given variable command parameter value to the givenDataOutputStream.- Specified by:
writeVariableArgumentin classAbstractTraciParameterWriter<Integer>- Parameters:
out- theDataOutputStreamto write the actual bytes toargument- the actual value to write to theDataOutputStream- Throws:
IOException- if something went wrong during writing
-