List of utility methods to do Collection Serialize
byte[] | serialize(List Serialize to byte array ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(bos); out.writeObject(features); byte[] result = bos.toByteArray(); out.close(); return result; |
void | serialize(Map serialize try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out))) { for (Map.Entry<String, Map<String, String>> section : in.entrySet()) { bw.write("["); bw.write(section.getKey()); bw.write("]"); bw.newLine(); for (Map.Entry<String, String> kv : section.getValue().entrySet()) { if (kv.getValue() != null) { ... |
void | serializeMap(Map, ?> map, File file) Serialize a Map. try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(file)); os.writeObject(map); os.close(); } catch (Exception e) { e.printStackTrace(); |
byte[] | serializeSet(Set> set) serialize Set if (set.isEmpty()) { return null; ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; byte[] bytes = null; try { baos = new ByteArrayOutputStream(); ... |
byte[] | SerializeVectorOfInts(Vector Serialize Vector Of Ints ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); try { out.writeInt(m.size()); for (int i = 0; i < m.size(); i++) { out.writeInt(m.get(i)); } catch (Exception e) { ... |