List of usage examples for org.apache.commons.lang3 SerializationUtils deserialize
public static <T> T deserialize(final byte[] objectData)
Deserializes a single Object from an array of bytes.
From source file:org.apache.flink.api.common.accumulators.ListAccumulator.java
@Override public ArrayList<T> getLocalValue() { ArrayList<T> arrList = new ArrayList<T>(); for (byte[] byteArr : localValue) { T item = SerializationUtils.deserialize(byteArr); arrList.add(item);/* w w w. j a v a 2 s .c o m*/ } return arrList; }
From source file:org.apache.flink.streaming.api.StreamConfig.java
@SuppressWarnings("unchecked") public List<String> getOutputName(int outputIndex) { return (List<String>) SerializationUtils.deserialize(config.getBytes(OUTPUT_NAME + outputIndex, null)); }
From source file:org.apache.flink.streaming.connectors.db.DefaultDBSerializer.java
@Override public T read(byte[] serializedObject) { return SerializationUtils.deserialize(serializedObject); }
From source file:org.apache.flink.streaming.connectors.kafka.config.StringSerializer.java
public T deserialize(String stringSerialized) { byte[] bytes = Base64.decodeBase64(stringSerialized); return SerializationUtils.deserialize(bytes); }
From source file:org.apache.flink.streaming.connectors.util.JavaDefaultStringSchema.java
@Override public String deserialize(byte[] message) { return SerializationUtils.deserialize(message); }
From source file:org.apache.flink.streaming.util.CollectorOutput.java
@Override public void collect(StreamRecord<T> record) { T copied = SerializationUtils.deserialize(SerializationUtils.serialize((Serializable) record.getValue())); list.add(record.copy(copied));//ww w .j a va 2 s.c om }
From source file:org.apache.flink.streaming.util.MockCollector.java
@Override public void collect(T record) { T copied = SerializationUtils.deserialize(SerializationUtils.serialize((Serializable) record)); outputs.add(copied); }
From source file:org.apache.flink.streaming.util.MockOutput.java
@Override public void collect(StreamRecord<T> record) { T copied = SerializationUtils.deserialize(SerializationUtils.serialize((Serializable) record.getValue())); outputs.add(copied); }
From source file:org.apache.flink.streaming.util.serialization.TypeSerializationTest.java
@SuppressWarnings("unchecked") @Test/*ww w . ja v a2 s . c om*/ public void functionTypeSerializationTest() { TypeWrapper<Integer> ser = new FunctionTypeWrapper<Integer>(new MyMap(), RichMapFunction.class, 0); byte[] serializedType = SerializationUtils.serialize(ser); TypeWrapper<Integer> ser2 = (TypeWrapper<Integer>) SerializationUtils.deserialize(serializedType); assertNotNull(ser.getTypeInfo()); assertNotNull(ser2.getTypeInfo()); assertEquals(ser.getTypeInfo(), ser2.getTypeInfo()); }
From source file:org.apache.flink.streaming.util.serialization.TypeSerializationTest.java
@SuppressWarnings("unchecked") @Test/*from w ww . j a va 2 s . c o m*/ public void objectTypeSerializationTest() { Integer instance = Integer.valueOf(22); TypeWrapper<Integer> ser = new ObjectTypeWrapper<Integer>(instance); byte[] serializedType = SerializationUtils.serialize(ser); TypeWrapper<Integer> ser2 = (TypeWrapper<Integer>) SerializationUtils.deserialize(serializedType); assertNotNull(ser.getTypeInfo()); assertNotNull(ser2.getTypeInfo()); assertEquals(ser.getTypeInfo(), ser2.getTypeInfo()); }