Using serialization in java, you can easily parse any serializable objects into a byte stream. Try using ObjectInputStream and ObjectOuputStream.
json . google-gson Java
JSON .
Android. android.os.Parcel
android (, ), .
, , differenct
.
, .
public static void main(String[] args) throws Exception {
Map<Integer, String> data = new HashMap<Integer, String>();
data.put(1, "hello");
data.put(2, "world");
System.out.println(data.toString());
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(byteOut);
out.writeObject(data);
ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
ObjectInputStream in = new ObjectInputStream(byteIn);
Map<Integer, String> data2 = (Map<Integer, String>) in.readObject();
System.out.println(data2.toString());
}