Read and write binary data

43 views
Skip to first unread message

Alipvke

unread,
Jul 25, 2017, 10:17:09 AM7/25/17
to DroidScript
I want to read and write a midi and gif file, to make a midi editor and gif editor. How to read (and write) a file binarily?

Aaron Christophel

unread,
Jul 25, 2017, 10:34:10 AM7/25/17
to DroidScript
Maybe it is possible to open it as a text file?

Steve Garman

unread,
Jul 25, 2017, 10:48:08 AM7/25/17
to DroidScript
If you know exactly what you are doing with the file formats, you can open the files for random access http://wiki.droidscript.me.uk/doku.php?id=sample_code:random_file_acces

Unless you are making very small byte-for-byte changes, you will almost certainly need to read from a source file and write to a destination file

This is not a method that is appropriate for a novice. You will probably need to know the formats inside out and understand how to indicate in the format that a record has a specific length etc.

Reply all
Reply to author
Forward
0 new messages