I’m making a 2D Minecraft or Terraria style game and I’m not sure on how to handle the storage portion for each block. Temporarily I have three arrays called blockType, posX and posY. If I want to read and write each of these arrays in some file what should the format be?
This seems like a largely philosophical question. How are you going to be accessing the data? Do you just want to write the temporary arrays into the file and then read them back out? Do you want to store indexed entries and get an entry by index? Are you saving when closing the program and reading when opening, or accessing during runtime, and are you going to have multiple threads attempting to read the file at the same time?
Perhaps you should first look at serialization ([here] and [here]) to produce binary files. Or, you could write the data out in
 format if you prefer and it's not too large.
If you can give me a little more information on what you're trying to do, I can give you some better ideas on how to go about reading and writing the data.