How can I convert my Map
byte[]
, and then write it to internal storage? I currently have:
try {
Either serialize like faylon mentioned, or implement your own mechanism to save and load your map. By saving, you iterate over all elements and save key-value pairs. By loading, you add them back. Implementing your own mechanism has the advantage that you can still use your persisted values when your program is used with another Java version.