Class HexDump
Provides a single function to take an array of bytes and display it in hexadecimal form.
Provenance: POI.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voiddump(byte[] data, long offset, OutputStream stream, int index) Dumps an array of bytes to an OutputStream.static voiddump(byte[] data, long offset, Appendable appendable, int index, int length) Dumps an array of bytes to an Appendable.static voiddump(byte[] data, Appendable appendable) Dumps an array of bytes to an Appendable.
- 
Field Details- 
EOLDeprecated.The line-separator (initializes to "line.separator" system property).
 
- 
- 
Constructor Details- 
HexDumppublic HexDump()Instances should NOT be constructed in standard programming.
 
- 
- 
Method Details- 
dumpDumps an array of bytes to an Appendable. The output is formatted for human inspection, with a hexadecimal offset followed by the hexadecimal values of the next 16 bytes of data and the printable ASCII characters (if any) that those bytes represent printed per each line of output.- Parameters:
- data- the byte array to be dumped
- appendable- the Appendable to which the data is to be written
- Throws:
- IOException- is thrown if anything goes wrong writing the data to appendable
- NullPointerException- if the output appendable is null
- Since:
- 2.12.0
 
- 
dumppublic static void dump(byte[] data, long offset, Appendable appendable, int index, int length) throws IOException, ArrayIndexOutOfBoundsException Dumps an array of bytes to an Appendable. The output is formatted for human inspection, with a hexadecimal offset followed by the hexadecimal values of the next 16 bytes of data and the printable ASCII characters (if any) that those bytes represent printed per each line of output.The offset argument specifies the start offset of the data array within a larger entity like a file or an incoming stream. For example, if the data array contains the third kibibyte of a file, then the offset argument should be set to 2048. The offset value printed at the beginning of each line indicates where in that larger entity the first byte on that line is located. - Parameters:
- data- the byte array to be dumped
- offset- offset of the byte array within a larger entity
- appendable- the Appendable to which the data is to be written
- index- initial index into the byte array
- length- number of bytes to dump from the array
- Throws:
- IOException- is thrown if anything goes wrong writing the data to appendable
- ArrayIndexOutOfBoundsException- if the index or length is outside the data array's bounds
- NullPointerException- if the output appendable is null
- Since:
- 2.12.0
 
- 
dumppublic static void dump(byte[] data, long offset, OutputStream stream, int index) throws IOException, ArrayIndexOutOfBoundsException Dumps an array of bytes to an OutputStream. The output is formatted for human inspection, with a hexadecimal offset followed by the hexadecimal values of the next 16 bytes of data and the printable ASCII characters (if any) that those bytes represent printed per each line of output.The offset argument specifies the start offset of the data array within a larger entity like a file or an incoming stream. For example, if the data array contains the third kibibyte of a file, then the offset argument should be set to 2048. The offset value printed at the beginning of each line indicates where in that larger entity the first byte on that line is located. All bytes between the given index (inclusive) and the end of the data array are dumped. This method uses the virtual machine's default charset.- Parameters:
- data- the byte array to be dumped
- offset- offset of the byte array within a larger entity
- stream- the OutputStream to which the data is to be written
- index- initial index into the byte array
- Throws:
- IOException- is thrown if anything goes wrong writing the data to stream
- ArrayIndexOutOfBoundsException- if the index is outside the data array's bounds
- NullPointerException- if the output stream is null
 
 
- 
System.lineSeparator().