Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pombredanne/python-javaobj-1

Open more actions menu
 
 

Repository files navigation

python-javaobj

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.

javaobj module exposes an API familiar to users of the standard library marshal, pickle and json modules.

Features

  • Java object instance unmarshaling
  • Java classes unmarshaling
  • Primitive values unmarshaling
  • Automatic conversion of Java Collections to python ones (HashMap => dict, ArrayList => list, etc)

Requirements

  • Python >= 2.6, but < 3.0 (porting to 3.0 is in progress)
  • Maven 2+ (for building test data of serialized objects. You can skip it if you do not plan to run tests.py)

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()

About

python-javaobj is a python library that provides functions for reading of Java objects serialized ObjectOutputStream.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 72.4%
  • Java 27.6%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.