<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><div dir="ltr"><blockquote type="cite">On Jan 23, 2023, at 7:49 AM, Pedro Lamarão <pedro.lamarao@prodist.com.br> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr">Em seg., 23 de jan. de 2023 às 07:36, Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> escreveu:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    <p>The HexDump functionality is, IMHO, more general, and I believe
      it deserves a more central place in the JDK, rather than some
      class in java.lang.foreign. In principle, users might want to
      produce hexdumps of byte buffers, segments, byte arrays,
      Collection<Byte>, ...<br></p>
    <p>(as I write this, I realize that the same argument might be
      applied to the memory inspection stuff, but I think it's a
      defensible move to keep layouts and segments together, which we
      have done in other places).</p>
    <p>Which of the two pieces of functionalities you find yourselves
      more in need of? Memory inspection (e.g. segment + layout ->
      string), or hexdump? Or both?</p></div></blockquote><div><br></div><div>In my experience, without prejudice to adding a hexdumper to JDK, such things are quickly and easily born wherever necessary.</div><div>An inspector does not seem quick and easy to write while debugging, so perhaps it would bring more value to the table.<br></div><div>Maybe the inspector could actually do both and somehow include a hexdump as part of the inspection.</div></div></div></div></blockquote><div><br></div>With the addition of HexFormat in JDK 17, a hexdumper is almost there already.<div>The interesting thing about this visualization is the mapping to fields of a data structure so I don’t have to hurt my brain doing that manually (not to mention reversing little-endian madness).  I can think of many times I would have used this to help debug many things, from decoding a media file, to inspecting a wire protocol.</div><div><br></div><div>Scott</div><div><br></div><div><br><blockquote type="cite"><div dir="ltr">
</div></blockquote></div></body></html>