Yuta HIGUCHI | ad4c218 | 2014-09-29 11:16:23 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.serializers; |
| 2 | |
| 3 | // TODO: To be replaced with SerializationService from IOLoop activity |
| 4 | /** |
| 5 | * Service to serialize Objects into byte array. |
| 6 | */ |
| 7 | public interface KryoSerializationService { |
| 8 | |
| 9 | /** |
| 10 | * Serializes the specified object into bytes using one of the |
| 11 | * pre-registered serializers. |
| 12 | * |
| 13 | * @param obj object to be serialized |
| 14 | * @return serialized bytes |
| 15 | */ |
| 16 | public byte[] serialize(final Object obj); |
| 17 | |
| 18 | /** |
| 19 | * Deserializes the specified bytes into an object using one of the |
| 20 | * pre-registered serializers. |
| 21 | * |
| 22 | * @param bytes bytes to be deserialized |
| 23 | * @return deserialized object |
| 24 | */ |
| 25 | public <T> T deserialize(final byte[] bytes); |
| 26 | |
| 27 | } |