The current 
serialization<http://doc.akka.io/docs/akka/snapshot/scala/serialization.html> 
has 
the following signature:


   1. // "toBinary" serializes the given object to an Array of Bytes
   2. def toBinary(obj: AnyRef): Array[Byte] = {
   3. // Put the code that serializes the object here
   4. // ... ...
   5. }
   6.  
   7. // "fromBinary" deserializes the given array,
   8. // using the type hint (if any, see "includeManifest" above)
   9. // into the optionally provided classLoader.
   10. def fromBinary(bytes: Array[Byte],
   11. clazz: Option[Class[_]]): AnyRef = {
   12. // Put your code that deserializes here
   13. // ... ...
   14. }


Is it possible to actually to get a reference to the underlying direct byte 
buffer instead? Conversely would it be possible to output a direct byte 
buffer too. Motivation: I am trying to write an Akka serializer for my own 
classes that are generated by the Simple Binary 
Encoding<https://github.com/real-logic/simple-binary-encoding> project. 
Simple Binary protocol uses a flyweight pattern on top of byte buffers 
avoiding a serialization/deserialization step. The benefit is lost a bit if 
I need to convert direct byte buffers to/from byte arrays.

Thanks,
Rajiv

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to