Skip to content
Advertisement

read a File in hex byteArray and write part of that array to another File – java android

I have a 200kb file and I have to read it in bytes, and then write part of this byteArray (from index 90000 to 165000) to another file. How can I accomplish this.

JavaScript

Advertisement

Answer

Use a RandomAccessFile in order to seek to the offset to start copying from.

For example:

JavaScript
Advertisement