Package org.djutils.decoderdumper
Class HexDumper
Dump data in hexadecimal format and (insofar possible) as characters.
Copyright (c) 2013-2024 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
hexDumper
(byte[] bytes) Create a HexDumper object with addressOffset 0; use it to dump an array of bytes and return the dump as a String.static String
hexDumper
(int addressOffset, byte[] bytes) Create a HexDumper object; use it to dump an array of bytes and return the dump as a String.toString()
Methods inherited from class org.djutils.decoderdumper.Dumper
addDecoder, addDecoder, append, append, append, append, flush, getMaximumWidth, setOutputStream, setSuppressMultipleIdenticalLines
-
Constructor Details
-
HexDumper
public HexDumper(int addressOffset) Construct a new HexDumper.- Parameters:
addressOffset
- int; address of the first byte that will be appended
-
HexDumper
public HexDumper()Construct a new HexDumper.
-
-
Method Details
-
hexDumper
Create a HexDumper object; use it to dump an array of bytes and return the dump as a String.- Parameters:
addressOffset
- int; address of the first bytebytes
- byte[]; the bytes to hex-dump- Returns:
- String; the hexadecimal and character dump of the
bytes
-
hexDumper
Create a HexDumper object with addressOffset 0; use it to dump an array of bytes and return the dump as a String.- Parameters:
bytes
- byte[]; the bytes to hex-dump- Returns:
- String; the hexadecimal and character dump of the
bytes
-
toString
-