org.jruby.util.io
Interface Stream

All Known Implementing Classes:
ChannelStream

public interface Stream


Field Summary
static ByteList PARAGRAPH_DELIMETER
           
static ByteList PARAGRAPH_SEPARATOR
           
static int SEEK_CUR
           
static int SEEK_END
           
static int SEEK_SET
           
 
Method Summary
 void clearerr()
           
 void fclose()
           
 boolean feof()
          Return true when at end of file (EOF).
 int fflush()
           
 int fgetc()
           
 long fgetpos()
          Get the current position within the file associated with this handler.
 ByteList fgets(ByteList separatorString)
           
 void fputc(int c)
           
 ByteList fread(int number)
           
 void freopen(Ruby runtime, java.lang.String path, ModeFlags modes)
           
 void ftruncate(long newLength)
           
 int fwrite(ByteList string)
           
 ChannelDescriptor getDescriptor()
           
 int getline(ByteList dst, byte terminator)
           
 ModeFlags getModes()
           
 boolean isBlocking()
           
 boolean isSync()
           
 void lseek(long offset, int type)
          Perform a seek based on pos().
 java.io.InputStream newInputStream()
           
 java.io.OutputStream newOutputStream()
           
 ByteList read(int number)
           
 ByteList readall()
           
 boolean readDataBuffered()
           
 int ready()
          Implement IO#ready? as per io/wait in MRI.
 void setBlocking(boolean blocking)
           
 void setSync(boolean sync)
           
 void sync()
          Flush and sync all writes to the filesystem.
 int ungetc(int c)
           
 void waitUntilReady()
          Implement IO#wait as per io/wait in MRI.
 boolean writeDataBuffered()
           
 

Field Detail

SEEK_SET

static final int SEEK_SET
See Also:
Constant Field Values

SEEK_CUR

static final int SEEK_CUR
See Also:
Constant Field Values

SEEK_END

static final int SEEK_END
See Also:
Constant Field Values

PARAGRAPH_DELIMETER

static final ByteList PARAGRAPH_DELIMETER

PARAGRAPH_SEPARATOR

static final ByteList PARAGRAPH_SEPARATOR
Method Detail

getDescriptor

ChannelDescriptor getDescriptor()

clearerr

void clearerr()

getModes

ModeFlags getModes()

isSync

boolean isSync()

setSync

void setSync(boolean sync)

fgets

ByteList fgets(ByteList separatorString)
               throws java.io.IOException,
                      BadDescriptorException,
                      java.io.EOFException
Throws:
java.io.IOException
BadDescriptorException
java.io.EOFException

readall

ByteList readall()
                 throws java.io.IOException,
                        BadDescriptorException,
                        java.io.EOFException
Throws:
java.io.IOException
BadDescriptorException
java.io.EOFException

getline

int getline(ByteList dst,
            byte terminator)
            throws java.io.IOException,
                   BadDescriptorException
Throws:
java.io.IOException
BadDescriptorException

fread

ByteList fread(int number)
               throws java.io.IOException,
                      BadDescriptorException,
                      java.io.EOFException
Throws:
java.io.IOException
BadDescriptorException
java.io.EOFException

fwrite

int fwrite(ByteList string)
           throws java.io.IOException,
                  BadDescriptorException
Throws:
java.io.IOException
BadDescriptorException

fgetc

int fgetc()
          throws java.io.IOException,
                 BadDescriptorException,
                 java.io.EOFException
Throws:
java.io.IOException
BadDescriptorException
java.io.EOFException

ungetc

int ungetc(int c)

fputc

void fputc(int c)
           throws java.io.IOException,
                  BadDescriptorException
Throws:
java.io.IOException
BadDescriptorException

read

ByteList read(int number)
              throws java.io.IOException,
                     BadDescriptorException,
                     java.io.EOFException
Throws:
java.io.IOException
BadDescriptorException
java.io.EOFException

fclose

void fclose()
            throws java.io.IOException,
                   BadDescriptorException
Throws:
java.io.IOException
BadDescriptorException

fflush

int fflush()
           throws java.io.IOException,
                  BadDescriptorException
Throws:
java.io.IOException
BadDescriptorException

sync

void sync()
          throws java.io.IOException,
                 BadDescriptorException

Flush and sync all writes to the filesystem.

Throws:
java.io.IOException - if the sync does not work
BadDescriptorException

feof

boolean feof()
             throws java.io.IOException,
                    BadDescriptorException

Return true when at end of file (EOF).

Returns:
true if at EOF; false otherwise
Throws:
java.io.IOException
BadDescriptorException

fgetpos

long fgetpos()
             throws java.io.IOException,
                    PipeException,
                    BadDescriptorException,
                    InvalidValueException

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

Returns:
the current position in the file.
Throws:
java.io.IOException
PipeException - ESPIPE (illegal seek) when not a file
BadDescriptorException
InvalidValueException

lseek

void lseek(long offset,
           int type)
           throws java.io.IOException,
                  InvalidValueException,
                  PipeException,
                  BadDescriptorException

Perform a seek based on pos().

Throws:
java.io.IOException
PipeException
InvalidValueException
BadDescriptorException

ftruncate

void ftruncate(long newLength)
               throws java.io.IOException,
                      PipeException,
                      InvalidValueException,
                      BadDescriptorException
Throws:
java.io.IOException
PipeException
InvalidValueException
BadDescriptorException

ready

int ready()
          throws java.io.IOException
Implement IO#ready? as per io/wait in MRI. returns non-nil if input available without blocking, or nil.

Throws:
java.io.IOException

waitUntilReady

void waitUntilReady()
                    throws java.io.IOException,
                           java.lang.InterruptedException
Implement IO#wait as per io/wait in MRI. waits until input available or timed out and returns self, or nil when EOF reached. The default implementation loops while ready returns 0.

Throws:
java.io.IOException
java.lang.InterruptedException

readDataBuffered

boolean readDataBuffered()

writeDataBuffered

boolean writeDataBuffered()

newInputStream

java.io.InputStream newInputStream()

newOutputStream

java.io.OutputStream newOutputStream()

isBlocking

boolean isBlocking()

setBlocking

void setBlocking(boolean blocking)
                 throws java.io.IOException
Throws:
java.io.IOException

freopen

void freopen(Ruby runtime,
             java.lang.String path,
             ModeFlags modes)
             throws DirectoryAsFileException,
                    java.io.IOException,
                    InvalidValueException,
                    PipeException,
                    BadDescriptorException
Throws:
DirectoryAsFileException
java.io.IOException
InvalidValueException
PipeException
BadDescriptorException


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