MCPcopy Create free account
hub / github.com/apache/storm / javaSerialize

Method javaSerialize

storm-client/src/jvm/org/apache/storm/utils/Utils.java:527–537  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

525 }
526
527 public static byte[] javaSerialize(Object obj) {
528 try {
529 ByteArrayOutputStream bos = new ByteArrayOutputStream();
530 ObjectOutputStream oos = new ObjectOutputStream(bos);
531 oos.writeObject(obj);
532 oos.close();
533 return bos.toByteArray();
534 } catch (IOException e) {
535 throw new RuntimeException(e);
536 }
537 }
538
539 public static <T> T javaDeserialize(byte[] serialized, Class<T> clazz) {
540 if ("true".equalsIgnoreCase(System.getProperty("java.deserialization.disabled"))) {

Calls 3

toByteArrayMethod · 0.80
closeMethod · 0.65
writeObjectMethod · 0.45

Tested by 7

classIsSerializableMethod · 0.76
classIsSerializableMethod · 0.76
testServerExistsTrueMethod · 0.76