com.caucho.quercus.lib.file
Class AbstractBinaryOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.quercus.lib.file.AbstractBinaryOutput
All Implemented Interfaces:
BinaryOutput, BinaryStream, java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
FileInputOutput, FileOutput, HttpInputOutput, PhpBinaryOutput, PhpStderr, PhpStdout, PopenOutput, ProcOpenOutput, ZlibOutputStream

public abstract class AbstractBinaryOutput
extends java.io.OutputStream
implements BinaryOutput

Represents a PHP open file


Field Summary
 
Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream
SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
AbstractBinaryOutput()
           
 
Method Summary
 void close()
          Closes the stream.
 void closeWrite()
          Closes the file.
 void flush()
          Flushes the output.
 java.io.OutputStream getOutputStream()
          Returns self as the output stream.
 long getPosition()
          Tells the position in the stream
 java.lang.String getResourceType()
           
 boolean isEOF()
          Returns false always for output streams
 void print(char v)
          Prints a string to a file.
 void print(java.lang.String v)
          Prints a string to a file.
 long seek(long offset, int whence)
          Seek according to offset and whence.
 boolean setPosition(long offset)
          Sets the position.
 Value stat()
          Returns an array filled with stat information.
 int write(java.io.InputStream is, int length)
          Writes to a stream.
 
Methods inherited from class java.io.OutputStream
write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryOutput
write
 

Constructor Detail

AbstractBinaryOutput

public AbstractBinaryOutput()
Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Returns self as the output stream.

Specified by:
getOutputStream in interface BinaryOutput

write

public int write(java.io.InputStream is,
                 int length)
Writes to a stream.

Specified by:
write in interface BinaryOutput

print

public void print(char v)
           throws java.io.IOException
Prints a string to a file.

Specified by:
print in interface BinaryOutput
Throws:
java.io.IOException

print

public void print(java.lang.String v)
           throws java.io.IOException
Prints a string to a file.

Specified by:
print in interface BinaryOutput
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the output.

Specified by:
flush in interface BinaryOutput
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

closeWrite

public void closeWrite()
Closes the file.

Specified by:
closeWrite in interface BinaryOutput

close

public void close()
Closes the stream.

Specified by:
close in interface BinaryOutput
Specified by:
close in interface BinaryStream
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

isEOF

public boolean isEOF()
Returns false always for output streams

Specified by:
isEOF in interface BinaryStream

getPosition

public long getPosition()
Tells the position in the stream

Specified by:
getPosition in interface BinaryStream

setPosition

public boolean setPosition(long offset)
Sets the position.

Specified by:
setPosition in interface BinaryStream

seek

public long seek(long offset,
                 int whence)
Description copied from interface: BinaryStream
Seek according to offset and whence. For fseek() compatibility in wrapped streams.

Specified by:
seek in interface BinaryStream

getResourceType

public java.lang.String getResourceType()

stat

public Value stat()
Description copied from interface: BinaryStream
Returns an array filled with stat information. Mainly for wrapped stream functionality.

Specified by:
stat in interface BinaryStream