code: public InputStream asInputStream() {
  
          if ( tmp != null )
              throw new RuntimeException("can create Input/OutputStream only once");
          tmp = new byte[1];
          return new InputStream() {
  
              @Override
              public void close() throws IOException {
                  AsyncFile.this.close();
              }
  
  
              @Override
              public int read() throws IOException {
                  // should rarely be called, super slow
                  int read = read(tmp, 0, 1);
                  if ( read < 1 ) {
                      return -1;
                  }
                  return (tmp[0]+256)&0xff;
              }
  
              @Override
              public int read(byte b[], int off, int len) throws IOException {
                  if ( event == null ) {
                      event = new AsyncFileIOEvent(0,0, ByteBuffer.allocate(len));
                  }
                  if ( event.getBuffer().capacity() < len ) {
                      event.buffer = ByteBuffer.allocate(len);
                  }
                  ByteBuffer buffer = event.buffer;
                  event.reset();
                  event = AsyncFile.this.read(event.getNextPosition(), len, buffer).await();
                  int readlen = event.getRead();
                  if ( readlen > 0 )
                      buffer.get(b,off,readlen);
                  return readlen;
              }
          };
      }
docs: /*
  return a pseudo-blocking input stream. Note: due to limitations of the current await implementation (stack based),
  when reading many files concurrently from a single actor thread don't mix high latency file locations (e.g. remote file systems vs. local)
  with low latency ones. If this is required, fall back to the more basic read/write methods returning futures.