<div dir="ltr">If I wanted to contribute a patch, can you suggest what you think would be the best path forward?  <div><br><div>I've listed some options but I'm sure there are more:</div><div><br></div><div>1.    It seems like amending the underlying issue in the native code underlying <span style="color:rgb(0,0,0);font-family:"JetBrains Mono",monospace;font-size:9.8pt">FileDispatcherImpl.seek()</span><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif"> so that it returns a value when asked for the position in the file instead of crashing would be the most durable fix.  That seems like possibly the most complex though since it's in the native code which I am not very familiar with.</font></span><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif">2.  Another possibility would be to modify FileChannelImpl.position() to return a value instead of throwing.  This would fix multiple issues ,for instance it's very possible that the returned InputStream from Files.newInputStream is at some point re-wrapped into a channel, and then benign looking calls to position() fail. </font></span></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif">ex: </font></span></div><div><div style="color:rgb(8,8,8)"><pre style="font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(0,0,0)">FileInputStream in </span>= <span style="color:rgb(0,51,179)">new </span>FileInputStream(<span style="color:rgb(6,125,23)">"/dev/stdin"</span>);<br><span style="color:rgb(0,0,0)">FileChannel channel </span>= <span style="color:rgb(0,0,0)">in</span>.getChannel();<br><span style="color:rgb(0,0,0)">channel</span>.position(); // throws</pre></div></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif">3.  Modify the available method on ChannelInputStream to return 0 in this case.</font></span></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif">4.  Modify the FileSystemProviders to return a different sort of InputStream if the underlying file isn't actually seekable.  You could for instance override it in UnixFilesSystem.</font></span></div></div></div><div><span style="color:rgb(0,0,0);font-size:9.8pt"><font face="arial, sans-serif"><br></font></span></div><div><font color="#000000" face="arial, sans-serif"><span style="font-size:13.0667px">Thank you.  I would love to help fix this problem.</span></font></div><div><font color="#000000" face="arial, sans-serif"><span style="font-size:13.0667px">Louis</span></font></div></div>