| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
python-javaobj is a python library that provides functions for reading and writing (writing is WIP currently) Java objects serialized or will be deserialized by ObjectOutputStream. This form of object representation is a standard data interchange format in Java world.
The javaobj module exposes an API familiar to users of the standard library marshal, pickle and json modules.
This project is a fork of python-javaobj by Volodymyr Buell, originally from Google Code and now hosted on GitHub.
This fork intends to work both on Python 2.7 and Python 3.4+.
As of version 0.2.0, the notion of object transformer from the original project as been replaced by an object creator.
The object creator is called before the deserialization. This allows to store the reference of the converted object before deserializing it, and avoids a mismatch between the referenced object and the transformed one.
As of version 0.2.3, bytes arrays are loaded as a bytes object instead of an array of integers.
Unmarshalling of Java serialised object:
import javaobj
jobj = self.read_file("obj5.ser")
pobj = javaobj.loads(jobj)
print(pobj)Or, you can use Unmarshaller object directly:
import javaobj
marshaller = javaobj.JavaObjectUnmarshaller(open("objCollections.ser"))
pobj = marshaller.readObject()
self.assertEqual(pobj.value, 17)
self.assertTrue(pobj.next)
pobj = marshaller.readObject()| Back | FazBrowse Home | New Git URL |