Home » Random Access Files

Random Access Files

Local Data Storage 8 – Random Access Files with Java

Random Access Files with Java Working with Java and Files Tutorial Trail Serialized XML to Files SQLite Database Random Access Files(API) (RAF) in Java are super easy to use. Use an RAF when you are doing more database-like operations vs document-like operations. With an RAF you can move to any location in the file based on the byte number.  Then read or write primitives and Strings. You can also read and write arrays of bytes. It would be easy enough to write a set of primitives associated with an object which is the object’s state, then reload and rebuild the object later. Six Examples So in this article, I will give you 6 examples of storing and reading – one, two and three dimensioned arrays of integers. The first 3 examples simply generate random numbers in arrays then wri...