The format Minecraft uses for most of the data it saves is called NBT (Named Binary Tag). This is basically a map of keys and values (just like a more limited version of a HashMap) that can easily be serialized to a binary representation to store in files.