org.jruby.util
Class IOHandlerNull

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

public class IOHandlerNull
extends IOHandler


Nested Class Summary
 
Nested classes inherited from class org.jruby.util.IOHandler
IOHandler.BadDescriptorException, IOHandler.InvalidValueException, IOHandler.PipeException
 
Field Summary
 
Fields inherited from class org.jruby.util.IOHandler
fileno, isOpen, isSync, modes, PARAGRAPH_DELIMETER, SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
IOHandlerNull(Ruby runtime, IOModes modes)
           
 
Method Summary
 IOHandler cloneIOHandler()
           
 void close()
           
 void flush()
           
 int getc()
           
 java.nio.channels.FileChannel getFileChannel()
           
 ByteList gets(ByteList separatorString)
           
 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 putc(int c)
           
 ByteList read(int number)
           
 int ready()
          Implement IO#ready? as per io/wait in MRI.
protected  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.
 ByteList sysread(int number)
           
 int syswrite(ByteList buf)
           
 int syswrite(int c)
           
 void truncate(long newLength)
           
 void ungetc(int c)
           
 int write(ByteList string)
           
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOHandlerNull

public IOHandlerNull(Ruby runtime,
                     IOModes modes)
Method Detail

getFileChannel

public java.nio.channels.FileChannel getFileChannel()
Specified by:
getFileChannel in class IOHandler

gets

public ByteList gets(ByteList separatorString)
              throws java.io.IOException,
                     IOHandler.BadDescriptorException,
                     java.io.EOFException
Specified by:
gets in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException

getsEntireStream

public ByteList getsEntireStream()
                          throws java.io.IOException,
                                 IOHandler.BadDescriptorException,
                                 java.io.EOFException
Specified by:
getsEntireStream in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException

read

public ByteList read(int number)
              throws java.io.IOException,
                     IOHandler.BadDescriptorException,
                     java.io.EOFException
Specified by:
read in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException

write

public int write(ByteList string)
          throws java.io.IOException,
                 IOHandler.BadDescriptorException
Specified by:
write in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

getc

public int getc()
         throws java.io.IOException,
                IOHandler.BadDescriptorException,
                java.io.EOFException
Specified by:
getc in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException

ungetc

public void ungetc(int c)
Specified by:
ungetc in class IOHandler

putc

public void putc(int c)
          throws java.io.IOException,
                 IOHandler.BadDescriptorException
Specified by:
putc in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

sysread

public ByteList sysread(int number)
                 throws java.io.IOException,
                        IOHandler.BadDescriptorException,
                        java.io.EOFException
Specified by:
sysread in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException
java.io.EOFException

syswrite

public int syswrite(ByteList buf)
             throws java.io.IOException,
                    IOHandler.BadDescriptorException
Specified by:
syswrite in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

syswrite

public int syswrite(int c)
             throws java.io.IOException,
                    IOHandler.BadDescriptorException
Specified by:
syswrite in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

cloneIOHandler

public IOHandler cloneIOHandler()
                         throws java.io.IOException,
                                IOHandler.PipeException,
                                IOHandler.InvalidValueException
Specified by:
cloneIOHandler in class IOHandler
Throws:
java.io.IOException
IOHandler.PipeException
IOHandler.InvalidValueException

close

public void close()
           throws java.io.IOException,
                  IOHandler.BadDescriptorException
Specified by:
close in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

flush

public void flush()
           throws java.io.IOException,
                  IOHandler.BadDescriptorException
Specified by:
flush in class IOHandler
Throws:
java.io.IOException
IOHandler.BadDescriptorException

sync

public void sync()
          throws java.io.IOException,
                 IOHandler.BadDescriptorException
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
IOHandler.BadDescriptorException

isEOF

public boolean isEOF()
              throws java.io.IOException,
                     IOHandler.BadDescriptorException
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
Throws:
IOHandler.BadDescriptorException
java.io.IOException

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

pos

public long pos()
         throws java.io.IOException,
                IOHandler.PipeException
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.
Throws:
IOHandler.PipeException - ESPIPE (illegal seek) when not a file
java.io.IOException

resetByModes

protected void resetByModes(IOModes newModes)
                     throws java.io.IOException,
                            IOHandler.InvalidValueException
Specified by:
resetByModes in class IOHandler
Throws:
java.io.IOException
IOHandler.InvalidValueException

rewind

public void rewind()
            throws java.io.IOException,
                   IOHandler.PipeException,
                   IOHandler.InvalidValueException
Specified by:
rewind in class IOHandler
Throws:
java.io.IOException
IOHandler.PipeException
IOHandler.InvalidValueException

seek

public void seek(long offset,
                 int type)
          throws java.io.IOException,
                 IOHandler.PipeException,
                 IOHandler.InvalidValueException
Description copied from class: IOHandler

Perform a seek based on pos().

Specified by:
seek in class IOHandler
Throws:
IOHandler.InvalidValueException
java.io.IOException
IOHandler.PipeException

truncate

public void truncate(long newLength)
              throws java.io.IOException,
                     IOHandler.PipeException
Specified by:
truncate in class IOHandler
Throws:
java.io.IOException
IOHandler.PipeException

ready

public int ready()
Description copied from class: IOHandler
Implement IO#ready? as per io/wait in MRI. returns non-nil if input available without blocking, or nil.

Specified by:
ready in class IOHandler


Copyright © 2002-2007 JRuby Team. All Rights Reserved.