nikhil kumar
nikhil kumar

Reputation: 21

Does okio FileHandle have something similar to RandomAccessFile.getchannel() in java?

My problem is if the buffer is split, I want to make it contagious. In java, I used FileChannel for this purpose.

Upvotes: 2

Views: 124

Answers (1)

Jesse Wilson
Jesse Wilson

Reputation: 40593

See the FileHandle API, which has source() and sink() methods to read or write sequentially. If you call sink().buffer() the result implements WritableByteChannel and source().buffer() implements ReadableByteChannel.

Upvotes: 2

Related Questions