Constructor and Description |
---|
HexDump()
Instances should NOT be constructed in standard programming.
|
Modifier and Type | Method and Description |
---|---|
static void |
dump(byte[] data,
Appendable appendable)
Dumps an array of bytes to an Appendable.
|
static void |
dump(byte[] data,
long offset,
Appendable appendable,
int index,
int length)
Dumps an array of bytes to an Appendable.
|
static void |
dump(byte[] data,
long offset,
OutputStream stream,
int index)
Dumps an array of bytes to an OutputStream.
|
@Deprecated public static final String EOL
System.lineSeparator()
.public HexDump()
public static void dump(byte[] data, Appendable appendable) throws IOException
data
- the byte array to be dumpedappendable
- the Appendable to which the data is to be writtenIOException
- is thrown if anything goes wrong writing
the data to appendableNullPointerException
- if the output appendable is nullpublic static void dump(byte[] data, long offset, Appendable appendable, int index, int length) throws IOException, ArrayIndexOutOfBoundsException
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.
data
- the byte array to be dumpedoffset
- offset of the byte array within a larger entityappendable
- the Appendable to which the data is to be writtenindex
- initial index into the byte arraylength
- number of bytes to dump from the arrayIOException
- is thrown if anything goes wrong writing
the data to appendableArrayIndexOutOfBoundsException
- if the index or length is
outside the data array's boundsNullPointerException
- if the output appendable is nullpublic static void dump(byte[] data, long offset, OutputStream stream, int index) throws IOException, ArrayIndexOutOfBoundsException
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.
data
- the byte array to be dumpedoffset
- offset of the byte array within a larger entitystream
- the OutputStream to which the data is to be
writtenindex
- initial index into the byte arrayIOException
- is thrown if anything goes wrong writing
the data to streamArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundsNullPointerException
- if the output stream is nullCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.