简体   繁体   中英

How do I print an array in Java's jdb debugger?

How do I print out the values of the byte array all at once? I seem to recall I could specify a memory range in gdb. Is similar functionality is available in jdb?

I have a Java byte array:

byte [] decompressed = new byte[OUTPUT_FILE_IO_BUFFER_SIZE];

which I populate from a String:

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

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

main[1] print decompressed

which returns:

 decompressed = instance of byte[7] (id=342)

One solution:

dump decompressed

This dumps the byte values! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM