From 1b1652329717d384dccb28fc2206b308b9db47bc Mon Sep 17 00:00:00 2001 From: Google Code Exporter Date: Sat, 21 Mar 2015 10:02:34 -0400 Subject: [PATCH] Migrating wiki contents from Google Code --- ProjectHome.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ProjectHome.md diff --git a/ProjectHome.md b/ProjectHome.md new file mode 100644 index 0000000..a9c2c6e --- /dev/null +++ b/ProjectHome.md @@ -0,0 +1,42 @@ +python-javaobj is a python library that provides functions for reading (writing is WIP) of Java objects +serialized or will be deserialized by ObjectOutputStream. This form of object +representation is a standard data interchange format in Java world. + +javaobj module exposes an API familiar to users of the standard library marshal, pickle and json modules. + +## Features ## + + * Java object instance unmarshaling + * Java class itself unmarshaling + * Primitive values unmarshaling + * Automatic conversion of Java Collections to python ones (HashMap => dict, ArrayList => list, etc) + +## Requirements ## + + * Python >= 2.6 + +## Usage ## + +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("sunExample.ser")) +pobj = marshaller.readObject() + +self.assertEqual(pobj.value, 17) +self.assertTrue(pobj.next) + +pobj = marshaller.readObject() +``` \ No newline at end of file