1- # javaobj-py3
1+ javaobj-py3
2+ ###########
23
34python-javaobj is a python library that provides functions for reading and
45writing (writing is WIP currently) Java objects serialized or will be
@@ -8,50 +9,54 @@ standard data interchange format in Java world.
89javaobj module exposes an API familiar to users of the standard library
910marshal, pickle and json modules.
1011
11- ## About this repository
12+ About this repository
13+ =====================
1214
1315This project is a fork of python-javaobj by Volodymyr Buell, originally from
14- [ Google Code] ( http://code.google.com/p/python-javaobj/ ) and now hosted on
15- [ GitHub] ( https://github.com/vbuell/python-javaobj ) .
16+ ` Google Code < http://code.google.com/p/python-javaobj/ >`_ and now hosted on
17+ ` GitHub < https://github.com/vbuell/python-javaobj >`_ .
1618
1719This fork intends to work both on Python 2.7 and Python 3.
1820
19- ## Features
21+ Features
22+ ========
2023
2124 * Java object instance unmarshaling
2225 * Java classes unmarshaling
2326 * Primitive values unmarshaling
2427 * Automatic conversion of Java Collections to python ones
2528 (_HashMap_ => dict, _ArrayList_ => list, etc)
2629
27- ## Requirements
30+ Requirements
31+ ============
2832
2933 * Python >= 2.7 or Python >= 3.2
3034 * Maven 2+ (for building test data of serialized objects.
3135 You can skip it if you do not plan to run tests.py)
3236
33- ## Usage
37+ Usage
38+ =====
3439
3540Unmarshalling of Java serialised object:
3641
37- ``` python
38- import javaobj
42+ .. code-block :: python
3943
40- jobj = self .read_file(" obj5.ser" )
41- pobj = javaobj.loads(jobj)
42- print pobj
43- ```
44+ import javaobj
45+
46+ jobj = self .read_file(" obj5.ser" )
47+ pobj = javaobj.loads(jobj)
48+ print (pobj)
4449
4550 Or, you can use Unmarshaller object directly:
4651
47- ``` python
48- import javaobj
49-
50- marshaller = javaobj.JavaObjectUnmarshaller( open ( " sunExample.ser " ))
51- pobj = marshaller.readObject( )
52-
53- self .assertEqual(pobj.value, 17 )
54- self .assertTrue (pobj.next )
55-
56- pobj = marshaller.readObject()
57- ```
52+ .. code-block :: python
53+
54+ import javaobj
55+
56+ marshaller = javaobj.JavaObjectUnmarshaller( open ( " sunExample.ser " ) )
57+ pobj = marshaller.readObject()
58+
59+ self .assertEqual (pobj.value, 17 )
60+ self .assertTrue(pobj.next)
61+
62+ pobj = marshaller.readObject()
0 commit comments