Int RamDataAccess#read(byte[])

While working on the code of my previous post I noticed a ‘theoretical problem’ in According to the javadoc of read(byte[]):

Reads up to b.length bytes of data from [...]
Returns: the total number of bytes read into the buffer

It doesn’t say when it returns less bytes (and to be fair I never had a runtime issue with this part of code) but it might. So just keep this post in mind :wink:



It will probably only read less bytes if the file end is reached or IOException occur?

Sorry for the late reply. There is no concrete documentation. It could theoretically also be a slow (network) disc.

1 Like