How does an InputStream object turn into a MappedByteBuffer object?

  java, question

How does an InputStream object turn into a MappedByteBuffer object?

To be precise, it cannot be converted.

  1. InputStream is just an input stream;
  2. MappedByteBuffer is a memory-mapped byte buffer that must be mapped to a File;

Although a File can be converted to an InputStream object, the InputStream object is not necessarily a File and cannot be converted.