|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.util.IOHandler
org.jruby.util.IOHandlerJavaIO
org.jruby.util.IOHandlerSeekable
public class IOHandlerSeekable
This file implements a seekable IO file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jruby.util.IOHandler |
---|
IOHandler.BadDescriptorException, IOHandler.InvalidValueException, IOHandler.PipeException |
Field Summary | |
---|---|
protected java.nio.ByteBuffer |
buffer
|
protected java.nio.channels.FileChannel |
channel
|
protected java.lang.String |
cwd
|
protected java.io.RandomAccessFile |
file
|
protected java.lang.String |
path
|
protected boolean |
reading
|
Fields inherited from class org.jruby.util.IOHandlerJavaIO |
---|
ungotc |
Fields inherited from class org.jruby.util.IOHandler |
---|
fileno, isOpen, isSync, modes, PARAGRAPH_DELIMETER, SEEK_CUR, SEEK_END, SEEK_SET |
Constructor Summary | |
---|---|
IOHandlerSeekable(Ruby runtime,
java.lang.String path,
IOModes modes)
|
Method Summary | |
---|---|
IOHandler |
cloneIOHandler()
|
void |
close()
Close IO handler resources. |
void |
finalize()
Ensure close (especially flush) when we're finished with |
void |
flush()
|
java.nio.channels.FileChannel |
getFileChannel()
|
java.io.InputStream |
getInputStream()
|
java.io.OutputStream |
getOutputStream()
|
ByteList |
getsEntireStream()
|
boolean |
isEOF()
Return true when at end of file (EOF). |
int |
pid()
Get the process ID associated with this handler. |
long |
pos()
Get the current position within the file associated with this handler. |
void |
resetByModes(IOModes newModes)
|
void |
rewind()
|
void |
seek(long offset,
int type)
Perform a seek based on pos(). |
void |
sync()
Flush and sync all writes to the filesystem. |
int |
sysread()
|
ByteList |
sysread(int number)
|
int |
syswrite(ByteList buf)
|
int |
syswrite(int c)
|
void |
truncate(long newLength)
|
Methods inherited from class org.jruby.util.IOHandlerJavaIO |
---|
getc, gets, putc, read, read, ready, sysread, ungetc, write |
Methods inherited from class org.jruby.util.IOHandler |
---|
checkOpen, checkPermissionsSubsetOf, checkReadable, checkWritable, checkWriteable, getFileno, getModes, getRuntime, hasPendingBuffered, isOpen, isReadable, isSync, isWriteable, reset, setFileno, setIsSync, waitUntilReady |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.RandomAccessFile file
protected java.lang.String path
protected java.lang.String cwd
protected java.nio.ByteBuffer buffer
protected boolean reading
protected java.nio.channels.FileChannel channel
Constructor Detail |
---|
public IOHandlerSeekable(Ruby runtime, java.lang.String path, IOModes modes) throws java.io.IOException, IOHandler.InvalidValueException
java.io.IOException
IOHandler.InvalidValueException
Method Detail |
---|
public ByteList getsEntireStream() throws java.io.IOException
getsEntireStream
in class IOHandlerJavaIO
java.io.IOException
public IOHandler cloneIOHandler() throws java.io.IOException, IOHandler.PipeException, IOHandler.InvalidValueException
cloneIOHandler
in class IOHandler
java.io.IOException
IOHandler.PipeException
IOHandler.InvalidValueException
public void close() throws java.io.IOException, IOHandler.BadDescriptorException
Close IO handler resources.
close
in class IOHandler
java.io.IOException
BadDescriptorException
IOHandler.BadDescriptorException
IOHandler.close()
public void flush() throws java.io.IOException, IOHandler.BadDescriptorException
flush
in class IOHandler
java.io.IOException
BadDescriptorException
IOHandler.BadDescriptorException
IOHandler.flush()
public java.io.InputStream getInputStream()
getInputStream
in class IOHandlerJavaIO
org.jruby.util.IOHandler#getInputStream()
public java.io.OutputStream getOutputStream()
getOutputStream
in class IOHandlerJavaIO
org.jruby.util.IOHandler#getOutputStream()
public boolean isEOF() throws java.io.IOException, IOHandler.BadDescriptorException
IOHandler
Return true when at end of file (EOF).
isEOF
in class IOHandler
java.io.IOException
BadDescriptorException
IOHandler.BadDescriptorException
IOHandler.isEOF()
public int pid()
IOHandler
Get the process ID associated with this handler.
pid
in class IOHandler
IOHandler.pid()
public long pos() throws java.io.IOException
IOHandler
Get the current position within the file associated with this handler.
pos
in class IOHandler
java.io.IOException
IOHandler.pos()
public void resetByModes(IOModes newModes) throws java.io.IOException, IOHandler.InvalidValueException
resetByModes
in class IOHandler
java.io.IOException
IOHandler.InvalidValueException
public void rewind() throws java.io.IOException, IOHandler.InvalidValueException
rewind
in class IOHandler
java.io.IOException
InvalidValueException
IOHandler.InvalidValueException
IOHandler.rewind()
public void seek(long offset, int type) throws java.io.IOException, IOHandler.InvalidValueException
IOHandler
Perform a seek based on pos().
seek
in class IOHandler
java.io.IOException
InvalidValueException
IOHandler.InvalidValueException
IOHandler.seek(long, int)
public void sync() throws java.io.IOException
IOHandler
Flush and sync all writes to the filesystem.
sync
in class IOHandler
java.io.IOException
- if the sync does not workIOHandler.sync()
public ByteList sysread(int number) throws java.io.IOException, IOHandler.BadDescriptorException
sysread
in class IOHandlerJavaIO
java.io.IOException
IOHandler.BadDescriptorException
public int sysread() throws java.io.IOException
sysread
in class IOHandlerJavaIO
java.io.IOException
org.jruby.util.IOHandler#sysread()
public int syswrite(ByteList buf) throws java.io.IOException, IOHandler.BadDescriptorException
syswrite
in class IOHandler
java.io.IOException
BadDescriptorException
IOHandler.BadDescriptorException
org.jruby.util.IOHandler#syswrite(String buf)
public int syswrite(int c) throws java.io.IOException, IOHandler.BadDescriptorException
syswrite
in class IOHandler
java.io.IOException
BadDescriptorException
IOHandler.BadDescriptorException
org.jruby.util.IOHandler#syswrite(String buf)
public void truncate(long newLength) throws java.io.IOException
truncate
in class IOHandler
java.io.IOException
public java.nio.channels.FileChannel getFileChannel()
getFileChannel
in class IOHandler
public void finalize()
finalize
in interface Finalizable
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |