org.jruby.util
Class IOHandlerUnseekable

java.lang.Object
  extended byorg.jruby.util.IOHandler
      extended byorg.jruby.util.IOHandlerUnseekable

public class IOHandlerUnseekable
extends IOHandler

Author:
enebo

Field Summary
protected  java.io.InputStream input
           
protected  java.io.OutputStream output
           
 
Fields inherited from class org.jruby.util.IOHandler
fileno, isOpen, isSync, modes, SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
IOHandlerUnseekable(Ruby ruby, java.io.InputStream inStream, java.io.OutputStream outStream)
           
IOHandlerUnseekable(Ruby ruby, int fileno)
           
IOHandlerUnseekable(Ruby ruby, int fileno, java.lang.String mode)
           
 
Method Summary
 IOHandler cloneIOHandler()
           
 void close()
          Close IO handler resources.
 void flush()
           
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 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 modes)
           
 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()
           
 int syswrite(java.lang.String buf)
           
 
Methods inherited from class org.jruby.util.IOHandler
checkOpen, checkPermissionsSubsetOf, checkReadable, checkWriteable, getc, getFileno, getModeString, getRuntime, gets, getsEntireStream, isOpen, isReadable, isSync, isWriteable, putc, read, read, reset, setFileno, setIsSync, sysread, ungetc, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected java.io.InputStream input

output

protected java.io.OutputStream output
Constructor Detail

IOHandlerUnseekable

public IOHandlerUnseekable(Ruby ruby,
                           java.io.InputStream inStream,
                           java.io.OutputStream outStream)
Parameters:
inStream -
outStream -

IOHandlerUnseekable

public IOHandlerUnseekable(Ruby ruby,
                           int fileno)

IOHandlerUnseekable

public IOHandlerUnseekable(Ruby ruby,
                           int fileno,
                           java.lang.String mode)
Method Detail

cloneIOHandler

public IOHandler cloneIOHandler()
Specified by:
cloneIOHandler in class IOHandler

close

public void close()

Close IO handler resources.

Specified by:
close in class IOHandler
See Also:
IOHandler.close()

flush

public void flush()
Specified by:
flush in class IOHandler
See Also:
IOHandler.flush()

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in class IOHandler
See Also:
IOHandler.getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()
Specified by:
getOutputStream in class IOHandler
See Also:
IOHandler.getOutputStream()

isEOF

public boolean isEOF()
Description copied from class: IOHandler

Return true when at end of file (EOF).

Specified by:
isEOF in class IOHandler
Returns:
true if at EOF; false otherwise
See Also:
IOHandler.isEOF()

pid

public int pid()
Description copied from class: IOHandler

Get the process ID associated with this handler.

Specified by:
pid in class IOHandler
Returns:
the pid if the IOHandler represents a process; otherwise -1
See Also:
IOHandler.pid()

pos

public long pos()
Description copied from class: IOHandler

Get the current position within the file associated with this handler.

Specified by:
pos in class IOHandler
Returns:
the current position in the file.
See Also:
IOHandler.pos()

resetByModes

public void resetByModes(IOModes modes)
Specified by:
resetByModes in class IOHandler

rewind

public void rewind()
Specified by:
rewind in class IOHandler
See Also:
IOHandler.rewind()

seek

public void seek(long offset,
                 int type)
Description copied from class: IOHandler

Perform a seek based on pos().

Specified by:
seek in class IOHandler
See Also:
IOHandler.seek(long, int)

sync

public void sync()
          throws java.io.IOException
Description copied from class: IOHandler

Flush and sync all writes to the filesystem.

Specified by:
sync in class IOHandler
Throws:
java.io.IOException - if the sync does not work
See Also:
IOHandler.sync()

sysread

public int sysread()
            throws java.io.IOException
Specified by:
sysread in class IOHandler
Throws:
java.io.IOException
See Also:
IOHandler.sysread()

syswrite

public int syswrite(java.lang.String buf)
Specified by:
syswrite in class IOHandler
See Also:
IOHandler.syswrite(String buf)


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.