Package org.djutils.serialization
Class SerialDataDecoder
java.lang.Object
org.djutils.serialization.SerialDataDecoder
- All Implemented Interfaces:
org.djutils.decoderdumper.Decoder
Decoder for inspection of serialized data. The SerialDataDecoder implements a state machine that processes one byte at a
time. Output is sent to the buffer (a StringBuilder).
Copyright (c) 2013-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Constructor Details
-
SerialDataDecoder
Construct a new SerialDataDecoder.- Parameters:
endianUtil
- the endian util to use to decode multi-byte values
-
-
Method Details
-
getResult
- Specified by:
getResult
in interfaceorg.djutils.decoderdumper.Decoder
-
getMaximumWidth
public final int getMaximumWidth()- Specified by:
getMaximumWidth
in interfaceorg.djutils.decoderdumper.Decoder
-
append
Decode one (more) byte. This method must return true when a line becomes full due to this call, otherwise this method must return false.- Specified by:
append
in interfaceorg.djutils.decoderdumper.Decoder
- Parameters:
address
- the address that corresponds with the byte, for printing purposes.theByte
- the byte to process- Returns:
- true if an output line has been completed by this call; false if at least one more byte can be appended to the local accumulator before the current output line is full
- Throws:
IOException
- when the output device throws this exception
-
ignoreForIdenticalOutputCheck
public final boolean ignoreForIdenticalOutputCheck()- Specified by:
ignoreForIdenticalOutputCheck
in interfaceorg.djutils.decoderdumper.Decoder
-