|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.python.core.io.IOBase
org.python.core.io.RawIOBase
public abstract class RawIOBase
Base class for raw binary I/O. RawIOBases wrap raw Java I/O objects (typically nio Channels). They provide a convenient means of handling raw Java I/O objects in the context of Python files. RawIOBases maintain state about their underlying I/O objects (such as their mode) and translate Java exceptions into PyExceptions. The read() method is implemented by calling readinto(); derived classes that want to support read() only need to implement readinto() as a primitive operation. In general, readinto() can be more efficient than read().
Field Summary |
---|
Fields inherited from class org.python.core.io.IOBase |
---|
DEFAULT_BUFFER_SIZE |
Constructor Summary | |
---|---|
RawIOBase()
|
Method Summary | |
---|---|
RawIOBase |
fileno()
Returns underlying file descriptor if one exists. |
abstract Channel |
getChannel()
Return the underlying Java nio Channel. |
ByteBuffer |
read(int size)
Read and return up to size bytes, contained in a ByteBuffer. |
ByteBuffer |
readall()
Read until EOF, using multiple read() calls. |
int |
readinto(ByteBuffer buf)
Read up to buf.remaining() bytes into buf. |
long |
readinto(ByteBuffer[] bufs)
Read bytes into each of the specified ByteBuffers. |
int |
write(ByteBuffer buf)
Write the given ByteBuffer to the IO stream. |
long |
write(ByteBuffer[] bufs)
Write the given ByteBuffers to the IO stream. |
Methods inherited from class org.python.core.io.IOBase |
---|
asInputStream, asOutputStream, checkClosed, checkReadable, checkWritable, close, closed, flush, isatty, readable, seek, seek, tell, truncate, writable |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RawIOBase()
Method Detail |
---|
public ByteBuffer read(int size)
size
- the number of bytes to read
public ByteBuffer readall()
public int readinto(ByteBuffer buf)
buf
- a ByteBuffer to read bytes into
public long readinto(ByteBuffer[] bufs)
bufs
- an array of ByteBuffers to read bytes into
public int write(ByteBuffer buf)
buf
- a ByteBuffer value
public long write(ByteBuffer[] bufs)
bufs
- an array of ByteBuffers
public RawIOBase fileno()
IOBase
fileno
in class IOBase
public abstract Channel getChannel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |