|
|||||||||
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
org.python.core.io.FileIO
public class FileIO
Raw I/O implementation for OS files.
Field Summary |
---|
Fields inherited from class org.python.core.io.IOBase |
---|
DEFAULT_BUFFER_SIZE |
Constructor Summary | |
---|---|
FileIO(FileChannel fileChannel,
String mode)
Construct a FileIO instance with the given FileChannel. |
|
FileIO(PyString name,
String mode)
Construct a FileIO instance for the specified file name. |
|
FileIO(String name,
String mode)
|
Method Summary | |
---|---|
InputStream |
asInputStream()
Coerce this into an InputStream if possible, or return null. |
OutputStream |
asOutputStream()
Coerce this into an OutputStream if possible, or return null. |
void |
close()
Flushes and closes the IO object. |
FileChannel |
getChannel()
Return the underlying Java nio Channel. |
boolean |
isatty()
Returns whether this is an 'interactive' stream. |
boolean |
readable()
Return whether this file was opened for reading. |
ByteBuffer |
readall()
Read until EOF with one readinto() call. |
int |
readinto(ByteBuffer buf)
Read up to buf.remaining() bytes into buf. |
long |
readinto(ByteBuffer[] bufs)
Read bytes into each of the specified ByteBuffers via scatter i/o. |
long |
seek(long pos,
int whence)
Seek to byte offset pos relative to position indicated by whence: 0 Start of stream (the default). pos should be >= 0; 1 Current position - whence may be negative; 2 End of stream - whence usually negative. |
long |
tell()
Return the current stream position. |
long |
truncate(long size)
Truncate file to size in bytes. |
boolean |
writable()
Return whether this file was opened for writing. |
int |
write(ByteBuffer buf)
Write the given ByteBuffer to the IO stream. |
long |
write(ByteBuffer[] bufs)
Write bytes from each of the specified ByteBuffers via gather i/o. |
Methods inherited from class org.python.core.io.RawIOBase |
---|
fileno, read |
Methods inherited from class org.python.core.io.IOBase |
---|
checkClosed, checkReadable, checkWritable, closed, flush, seek |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileIO(String name, String mode)
FileIO(PyString name, String mode)
public FileIO(PyString name, String mode)
name
- the name of the filemode
- a raw io file mode Stringpublic FileIO(FileChannel fileChannel, String mode)
fileChannel
- a FileChannel objectmode
- a raw io file mode StringMethod Detail |
---|
public boolean isatty()
IOBase
isatty
in class IOBase
public int readinto(ByteBuffer buf)
RawIOBase
readinto
in class RawIOBase
buf
- a ByteBuffer to read bytes into
public long readinto(ByteBuffer[] bufs)
readinto
in class RawIOBase
bufs
- an array of ByteBuffers to read bytes into
public ByteBuffer readall()
readall
in class RawIOBase
public int write(ByteBuffer buf)
RawIOBase
write
in class RawIOBase
buf
- a ByteBuffer value
public long write(ByteBuffer[] bufs)
write
in class RawIOBase
bufs
- an array of ByteBuffers
public long seek(long pos, int whence)
IOBase
seek
in class IOBase
pos
- a long position valuewhence
- an int whence value
public long tell()
IOBase
tell
in class IOBase
public long truncate(long size)
IOBase
truncate
in class IOBase
size
- a long size to truncate to
public void close()
IOBase
close
in class IOBase
public OutputStream asOutputStream()
IOBase
asOutputStream
in class IOBase
public InputStream asInputStream()
IOBase
asInputStream
in class IOBase
public boolean readable()
IOBase
readable
in class IOBase
public boolean writable()
IOBase
writable
in class IOBase
public FileChannel getChannel()
RawIOBase
getChannel
in class RawIOBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |