I am trying to write a function that takes file, offset and byte array parameters and writes this byte array to a File object in Java.
So the function will look like
public void write(File file, long offset, byte[] data)
But the problem is that the offset parameter is long, so I cannot use the write () function for the OutputStream, which takes an integer as an offset.
Unlike an InputStream, which has a gap (long), it seems that the OutputStream is not able to skip the first bytes of the file.
Is there a good way to solve this problem?
Thanks.
so_ju source share