Package org.djutils.serialization.util
Class SerialDataDumper
- java.lang.Object
-
- org.djutils.decoderdumper.Dumper<SerialDataDumper>
-
- org.djutils.serialization.util.SerialDataDumper
-
public class SerialDataDumper extends Dumper<SerialDataDumper>
Dumper for serialized data.Copyright (c) 2019-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.version Jun 27, 2019
- Author:
- Alexander Verbraeck, Peter Knoppers
-
-
Constructor Summary
Constructors Constructor Description SerialDataDumper(EndianUtil endianUtil)
Construct a new SerialDataDumper.SerialDataDumper(EndianUtil endianUtil, int addressOffset)
Construct a new SerialDataDumper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
serialDataDumper(EndianUtil endianUtil, byte[] bytes)
Create a SerialDataDumper object with addressOffset 0; use it to dump an array of bytes and return the dump as a String.static String
serialDataDumper(EndianUtil endianUtil, int addressOffset, byte[] bytes)
Create a SerialDataDumper object; use it to dump an array of bytes and return the dump as a String.String
toString()
-
Methods inherited from class org.djutils.decoderdumper.Dumper
addDecoder, addDecoder, append, append, append, append, flush, getMaximumWidth, setOutputStream, setSuppressMultipleIdenticalLines
-
-
-
-
Constructor Detail
-
SerialDataDumper
public SerialDataDumper(EndianUtil endianUtil, int addressOffset)
Construct a new SerialDataDumper.- Parameters:
endianUtil
- EndianUtil; used to decode multi-byte valuesaddressOffset
- int; address of the first byte that will be processed
-
SerialDataDumper
public SerialDataDumper(EndianUtil endianUtil)
Construct a new SerialDataDumper.- Parameters:
endianUtil
- EndianUtil; used to decode multi-byte values
-
-
Method Detail
-
serialDataDumper
public static String serialDataDumper(EndianUtil endianUtil, int addressOffset, byte[] bytes)
Create a SerialDataDumper object; use it to dump an array of bytes and return the dump as a String.- Parameters:
endianUtil
- EndianUtil; used to decode multi-byte valuesaddressOffset
- int; address of the first bytebytes
- byte[]; the bytes to hex-dump- Returns:
- String; the hexadecimal and character dump of the
bytes
-
serialDataDumper
public static String serialDataDumper(EndianUtil endianUtil, byte[] bytes)
Create a SerialDataDumper object with addressOffset 0; use it to dump an array of bytes and return the dump as a String.- Parameters:
endianUtil
- EndianUtil; used to decode multi-byte valuesbytes
- byte[]; the bytes to hex-dump- Returns:
- String; the hexadecimal and character dump of the
bytes
-
toString
public String toString()
- Overrides:
toString
in classDumper<SerialDataDumper>
-
-