RandomAccessFile-like API for in-memory byte array?

前端 未结 4 1287
情书的邮戳
情书的邮戳 2021-01-11 16:20

I need to replace code using RandomAccessFile with one that uses in-memory byte buffer (such as byte[] or derivatives like ByteArrayInputStre

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-11 16:43

    ByteArrayInputStream can do it:

    • read() works the same.
    • seek(n) can be replaced with reset() followed by skip(n)

提交回复
热议问题