Top Inners Fields Constructors Methods
org.python.modules.bz2

public Class PyBZ2File

extends PyObject
implements FinalizablePyObject, FinalizableBuiltin
Class Inheritance
All Implemented Interfaces
org.python.core.finalization.FinalizableBuiltin, org.python.core.finalization.FinalizablePyObject
Known Direct Subclasses
org.python.modules.bz2.PyBZ2FileDerived
Annotations
@Untraversable
@ExposedType
name:bz2.BZ2File
Imports
java.io.BufferedInputStream, .File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, java.util.Iterator, org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream, .BZip2CompressorOutputStream, org.python.core.ArgParser, .Py, .PyException, .PyIterator, .PyList, .PyLong, .PyNone, .PyObject, .PySequence, .PyString, .PyType, .Untraversable, org.python.core.finalization.FinalizablePyObject, .FinalizableBuiltin, .FinalizeTrigger, org.python.core.io.BinaryIOWrapper, .BufferedReader, .BufferedWriter, .IOBase, .StreamIO, .TextIOBase, .UniversalIOWrapper, org.python.expose.ExposedGet, .ExposedMethod, .ExposedNew, .ExposedType

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private TextIOBase
private int
private String
private boolean
private boolean
private boolean
private boolean
private boolean
public static final PyType
Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtype

Constructor Summary

AccessConstructor and Description
public
public
PyBZ2File(PyType subType)

Method Summary

Modifier and TypeMethod and Description
public void
public void
__del_builtin__()

Implements org.python.core.finalization.FinalizableBuiltin.__del_builtin__.

__del_builtin__() is the built-in's own finalizer, while FinalizablePyObjectDerived#__del_derived__() refers to an instance's in-dict __del__.

public PyObject
__iter__()

Overrides org.python.core.PyObject.__iter__.

Return an iterator that is used to iterate the element of this sequence.

public PyObject
public boolean
BZ2File___exit__(PyObject exc_type, PyObject exc_value, PyObject traceback)

pack-priv final void
private void
BZ2File___init__(PyString inFileName, String mode, int buffering, int compresslevel)

public void
private void
public PyObject
BZ2File_next(PyObject[] args, String[] kwds)

public PyObject
BZ2File_read(PyObject[] args, String[] kwds)

public PyString
public PyList
public void
BZ2File_seek(PyObject[] args, String[] kwds)

public PyLong
public void
BZ2File_write(PyObject[] args, String[] kwds)

public void
public PyList
private void
private void
private void
private void
public PyObject
Inherited from org.python.core.PyObject:
__abs____add____and____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____cmp____coerce____coerce_ex____complex____contains____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____eq____findattr____findattr____findattr_ex____finditem____finditem____finditem____float____floordiv____format____ge____get____getattr____getattr____getitem____getitem____getnewargs____getslice____getslice____gt____hash____hex____iadd____iand____idiv____idivmod____ifloordiv____ilshift____imod____imul____index____int____invert____ior____ipow____irshift____isub____iternext____itruediv____ixor____le____len____long____lshift____lt____mod____mul____ne____neg____nonzero____not____oct____or____pos____pow____pow____radd____rand____rawdir____rdiv____rdivmod____reduce____reduce_ex____reduce_ex____repr____rfloordiv____rlshift____rmod____rmul____ror____rpow____rrshift____rshift____rsub____rtruediv____rxor____set____setattr____setattr____setitem____setitem____setitem____setslice____setslice____str____sub____tojava____truediv____trunc____unicode____xor___add_and_callextra_cmp_div_divmod_doget_doget_doset_eq_floordiv_ge_gt_iadd_iand_idiv_idivmod_ifloordiv_ilshift_imod_imul_in_ior_ipow_irshift_is_isnot_isub_itruediv_ixor_jcall_jcallexc_jthrow_le_lshift_lt_mod_mul_ne_notin_or_pow_rshift_sub_truediv_unsupportedop_xoradaptToCoerceTupleasDoubleasIndexasIndexasIntasIntasIterableasLongasLongasNameasNameasStringasStringasStringOrNullasStringOrNullbit_lengthconjugatedelDictdelTypedispatch__init__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypehashCodeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisMappingTypeisNumberTypeisSequenceTypemergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___subclasshook__readonlyAttributeErrorrunsupportedopMessagesetDictsetTypetoStringunsupportedopMessage

Field Detail

bufferback to summary
private TextIOBase buffer
bufferingback to summary
private int buffering
fileNameback to summary
private String fileName
inIterModeback to summary
private boolean inIterMode
inReadModeback to summary
private boolean inReadMode
inUniversalNewlineModeback to summary
private boolean inUniversalNewlineMode
inWriteModeback to summary
private boolean inWriteMode
needReadBufferInitback to summary
private boolean needReadBufferInit
TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

Constructor Detail

PyBZ2Fileback to summary
public PyBZ2File()
PyBZ2Fileback to summary
public PyBZ2File(PyType subType)

Method Detail

__del__back to summary
public void __del__()

Implements org.python.core.finalization.FinalizablePyObject.__del__.

Annotations
@Override
@ExposedMethod
__del_builtin__back to summary
public void __del_builtin__()

Implements org.python.core.finalization.FinalizableBuiltin.__del_builtin__.

Doc from org.python.core.finalization.FinalizableBuiltin.__del_builtin__.

__del_builtin__() is the built-in's own finalizer, while FinalizablePyObjectDerived#__del_derived__() refers to an instance's in-dict __del__. A FinalizeTrigger calls FinalizablePyObjectDerived#__del_derived__() first and - if existent - __del_builtin__() after that. A plain FinalizablePyObject#__del__() would behave as overridden by FinalizablePyObjectDerived#__del_derived__(), i.e. won't be called if the type implements FinalizablePyObjectDerived, while __del_builtin__() is called in any case.

Annotations
@Override
__iter__back to summary
public PyObject __iter__()

Overrides org.python.core.PyObject.__iter__.

Doc from org.python.core.PyObject.__iter__.

Return an iterator that is used to iterate the element of this sequence. From version 2.2, this method is the primary protocol for looping over sequences.

If a PyObject subclass should support iteration based in the __finditem__() method, it must supply an implementation of __iter__() like this:

public PyObject __iter__() {
    return new PySequenceIter(this);
}
When iterating over a python sequence from java code, it should be done with code like this:
for (PyObject item : seq.asIterable()) {
    // Do something with item
}
Annotations
@Override
@ExposedMethod
BZ2File___enter__back to summary
public PyObject BZ2File___enter__()
Annotations
@ExposedMethod
BZ2File___exit__back to summary
public boolean BZ2File___exit__(PyObject exc_type, PyObject exc_value, PyObject traceback)
Annotations
@ExposedMethod
BZ2File___init__back to summary
pack-priv final void BZ2File___init__(PyObject[] args, String[] kwds)
Annotations
@ExposedNew
@ExposedMethod
BZ2File___init__back to summary
private void BZ2File___init__(PyString inFileName, String mode, int buffering, int compresslevel)
BZ2File_closeback to summary
public void BZ2File_close()
Annotations
@ExposedMethod
BZ2File_flushback to summary
private void BZ2File_flush()
BZ2File_nextback to summary
public PyObject BZ2File_next(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_readback to summary
public PyObject BZ2File_read(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_readlineback to summary
public PyString BZ2File_readline(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_readlinesback to summary
public PyList BZ2File_readlines(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_seekback to summary
public void BZ2File_seek(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_tellback to summary
public PyLong BZ2File_tell()
Annotations
@ExposedMethod
BZ2File_writeback to summary
public void BZ2File_write(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_writelinesback to summary
public void BZ2File_writelines(PyObject[] args, String[] kwds)
Annotations
@ExposedMethod
BZ2File_xreadlinesback to summary
public PyList BZ2File_xreadlines()
Annotations
@ExposedMethod
checkFileWritableback to summary
private void checkFileWritable()
checkInIterModeback to summary
private void checkInIterMode()
checkReadBufferInitback to summary
private void checkReadBufferInit()
makeReadBufferback to summary
private void makeReadBuffer()
PyBZ2File_newlinesback to summary
public PyObject PyBZ2File_newlines()
Annotations
@ExposedGet
name:newlines
org.python.modules.bz2 back to summary

private Class PyBZ2File.BZ2FileIterator

extends PyIterator
Class Inheritance

Field Summary

Inherited from org.python.core.PyIterator:
__doc__nextstopException

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public PyObject
__iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Return the next element of the sequence that this is an iterator for.

Inherited from org.python.core.PyIterator:
__iter____tojava__doNextiteratornextrefersDirectlyTotraverse

Constructor Detail

BZ2FileIteratorback to summary
private BZ2FileIterator()

Method Detail

__iternext__back to summary
public PyObject __iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Doc from org.python.core.PyObject.__iternext__.

Return the next element of the sequence that this is an iterator for. Returns null when the end of the sequence is reached.

Annotations
@Override
org.python.modules.bz2 back to summary

private Class PyBZ2File.SkippableStreamIO

extends StreamIO
Class Inheritance

Field Summary

Modifier and TypeField and Description
private long

Constructor Summary

AccessConstructor and Description
public
SkippableStreamIO(InputStream inputStream, boolean closefd)

public
SkippableStreamIO(OutputStream outputStream, boolean closefd)

Method Summary

Modifier and TypeMethod and Description
public int
readinto(ByteBuffer
a ByteBuffer to read bytes into
buf
)

Overrides org.python.core.io.StreamIO.readinto.

Read up to buf.remaining() bytes into buf.

public long
seek(long
a long position value
offset
,
int
an int whence value
whence
)

Overrides org.python.core.io.IOBase.seek.

Seek to byte offset pos relative to position indicated by whence.

public long
tell()

Overrides org.python.core.io.IOBase.tell.

Return the current stream position.

Inherited from org.python.core.io.StreamIO:
asInputStreamasOutputStreamcloseflushgetChannelisattyreadablewritablewrite

Field Detail

positionback to summary
private long position

Constructor Detail

SkippableStreamIOback to summary
public SkippableStreamIO(InputStream inputStream, boolean closefd)
SkippableStreamIOback to summary
public SkippableStreamIO(OutputStream outputStream, boolean closefd)

Method Detail

readintoback to summary
public int readinto(ByteBuffer buf)

Overrides org.python.core.io.StreamIO.readinto.

Doc from org.python.core.io.RawIOBase.readinto.

Read up to buf.remaining() bytes into buf. Returns number of bytes read (0 for EOF).

Parameters
buf:ByteBuffer

a ByteBuffer to read bytes into

Returns:int

the amount of data read as an int

Annotations
@Override

seekback to summary
public long seek(long offset, int whence)

Overrides org.python.core.io.IOBase.seek.

Doc from org.python.core.io.IOBase.seek.

Seek to byte offset pos relative to position indicated by whence.

Semantics
whence Seek to pos
0 Start of stream (the default).Should be ≥0.
1 Current position + pos Either sign.
2 End of stream + pos Usually ≤0.
Returns the new absolute position.
Parameters
offset:long

a long position value

whence:int

an int whence value

Returns:long

a long position value seeked to

Annotations
@Override

tellback to summary
public long tell()

Overrides org.python.core.io.IOBase.tell.

Doc from org.python.core.io.IOBase.tell.

Return the current stream position.

Returns:long

a long position value

Annotations
@Override