MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / serialize

Method serialize

src/main/java/fieldbox/io/Raft.java:320–326  ·  view source on GitHub ↗
(Serializable value)

Source from the content-addressed store, hash-verified

318 }
319
320 private String serialize(Serializable value) throws IOException {
321 ByteArrayOutputStream a = new ByteArrayOutputStream();
322 try (ObjectOutputStream oos = new ObjectOutputStream(a)) {
323 oos.writeObject(value);
324 return Base64.getEncoder().encodeToString(a.toByteArray());
325 }
326 }
327
328 private Object deserialize(String value) throws IOException, ClassNotFoundException {
329 byte[] a = Base64.getDecoder().decode(value);

Callers 1

toValueMethod · 0.95

Calls 1

writeObjectMethod · 0.45

Tested by

no test coverage detected