Closed ams-tschoening closed 7 years ago
Actually, there were 2 implementations of Java runtime: older one that used RandomAccessFile + ByteArrayInputStream, and a newer one, which uses ByteBuffer backed by channels (now in git master).
Older one used to propagate IOExceptions thrown frequently by many read / seek / query operations. Indeed, currently all these IOExceptions are not needed, at least if you don't want to be able to swap older / newer implementations.
I got my answer and the merge, so closing this.
I wonder why lot's of methods in the runtime say to throw an
IOException
, when the accessed methods of the underlyingByteBuffer
actually don't?isEof
,seek
,size
, none of the methods ofByteBuffer
called seem to throwIOException
, even lots of the read methods don't. ComparereadS1
toreadS2be
, the former doesn't even say to throwIOException
, the latter does, while actually the underlyingByteBuffer
doesn't throw in both cases.In my opinion it would be easier for all users of your code to remove all unnecessary
throws
statements and I would like to do so and provide a pull request. But I might be missing something...