Closed streams in java binding. Added python bindings