CRC/Inflater/Deflater/Adler32 methods that take a ByteBuffer throw UOE if backed by shared memory segment

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: core-libs
    • None

      The methods in java.util.zip.{CRC,Inflater,Deflater,Alder32} that accept a ByteBuffer need to be update to deal with a ByteBuffer that is backed by a MemorySegment in a shared arena, e.g. the following throws UOE:

              var crc = new CRC32();
              try (var arena = Arena.ofShared()) {
                  ByteBuffer bb = arena.allocate(100).asByteBuffer();
                  crc.update(bb);
              }

      In implementation terms, the use of ((DirectBuffer)buffer).address() in these classes need to change to use NIO_ACCESS.getBufferAdress().

            Assignee:
            Per-Ake Minborg
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: