Methods Summary |
---|
public static void | dump(byte[] data, long offset, java.io.OutputStream stream, int index)Dump an array of bytes to an OutputStream.
if ((index < 0) || (index >= data.length)) {
throw new ArrayIndexOutOfBoundsException(
"illegal index: " + index + " into array of length "
+ data.length);
}
if (stream == null) {
throw new IllegalArgumentException("cannot write to nullstream");
}
long display_offset = offset + index;
StringBuffer buffer = new StringBuffer(74);
for (int j = index; j < data.length; j += 16) {
int chars_read = data.length - j;
if (chars_read > 16) {
chars_read = 16;
}
dump(buffer, display_offset).append(' ");
for (int k = 0; k < 16; k++) {
if (k < chars_read) {
dump(buffer, data[k + j]);
} else {
buffer.append(" ");
}
buffer.append(' ");
}
for (int k = 0; k < chars_read; k++) {
if ((data[k + j] >= ' ") && (data[k + j] < 127)) {
buffer.append((char) data[k + j]);
} else {
buffer.append('.");
}
}
buffer.append(EOL);
stream.write(buffer.toString().getBytes());
stream.flush();
buffer.setLength(0);
display_offset += chars_read;
}
|
private static java.lang.StringBuffer | dump(java.lang.StringBuffer _lbuffer, long value)Dump a long value into a StringBuffer.
for (int j = 0; j < 8; j++) {
_lbuffer
.append(_hexcodes[((int) (value >> _shifts[j])) & 15]);
}
return _lbuffer;
|
private static java.lang.StringBuffer | dump(java.lang.StringBuffer _cbuffer, byte value)Dump a byte value into a StringBuffer.
for (int j = 0; j < 2; j++) {
_cbuffer.append(_hexcodes[(value >> _shifts[j + 6]) & 15]);
}
return _cbuffer;
|