How to print an array in jdb java debugger?

How to print byte array values ​​at once? It seems I remember, I could specify a range of memory in gdb. Is similar functionality available in jdb?

I have a Java byte array:

byte [] decompressed = new byte[OUTPUT_FILE_IO_BUFFER_SIZE];

which I fill out from the line:

System.arraycopy(decompressedString.getBytes(), 0, decompressed, 0, 
                         decompressedString.length());

In jdb, I want to print the contents of a byte array. I tried

main[1] print decompressed

which returns:

 decompressed = instance of byte[7] (id=342)
+3
source share
1 answer

One solution:

dump decompressed

Resets byte values! :)

+2
source

Source: https://habr.com/ru/post/1724841/


All Articles