<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Glavo,<br>
      we do not have plans to update these APIs at the moment. It is
      possible to map a segment into a bytebuffer and then to use
      existing methods. Of course, as you mention, this will suffer from
      issues if the segment is too big to fit in to a buffer, but I
      guess we'd like to assess how big of an issue that is, what kind
      of workaround would clients need to write etc. before doing a
      blanket sprinkling of MS in the entire JDK.</p>
    <p>Looking at your list, concretely:</p>
    <p>
      <blockquote type="cite">
        <div>
          <ol>
            <li>X-Buffer::get(int, MemorySegment, long, long)</li>
            <li>X-Buffer::put(int, MemorySegment, long, long)</li>
            <li>ReadableByteChannel::read(MemorySegment, long, long)</li>
            <li>WritableByteChannel::write(MemorySegment, long, long)</li>
            <li>InputStream::read(MemorySegment, long, long)</li>
            <li>OutputStream::write(MemorySegment, long, long)</li>
            <li>Checksum::update(MemorySegment, long, long)</li>
            <li>Deflater::setInput(MemorySegment, long, long)</li>
            <li>Deflater::deflate(MemorySegment, long, long)</li>
            <li>Inflater::setInput(MemorySegment, long, long)</li>
            <li>Inflater::inflate(MemorySegment, long, long)</li>
            <li>Files.readAllBytesToNative(Path): MemorySegment<br>
            </li>
            <li>Files.write(Path, MemorySegment, OpenOpetion...)</li>
          </ol>
        </div>
      </blockquote>
    </p>
    <p>It seems like you are conflating two aspects:</p>
    <p>* there are some methods that are accepting a ByteBuffer today,
      so the question is whether they should accept a MS in the future
      (3, 4, 7, 8, 9, 10, 11)<br>
      * there are other methods that are accepting a byte[] today, the
      question is whether we want to enhance them to work on
      buffer/segments (1, 2, 5, 6, 12, 13)</p>
    <p>IMHO, the first group has a somewhat higher priority than the
      second (methods in that group don't even work with BB today, is
      there really a demand to have them working with MS?)</p>
    <p>And, in the first group, my hunch is that doing
      Readable/WriteableFileChannel will address 80% of the use cases?</p>
    <p>Maurizio<br>
    </p>
    <p><br>
    </p>
    <br>
  </body>
</html>