com.caucho.quercus.lib.file
Class PopenOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.quercus.lib.file.AbstractBinaryOutput
          extended by com.caucho.quercus.lib.file.PopenOutput
All Implemented Interfaces:
EnvCleanup, BinaryOutput, BinaryStream, java.io.Closeable, java.io.Flushable

public class PopenOutput
extends AbstractBinaryOutput
implements EnvCleanup

Represents an output stream for a popen'ed process.


Field Summary
 
Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream
SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
PopenOutput(Env env, java.lang.Process process)
           
 
Method Summary
 void cleanup()
          Implements the EnvCleanup interface.
 void close()
          Closes the file.
 void closeWrite()
          Closes the file.
 void flush()
          Flushes the output.
 java.io.OutputStream getOutputStream()
          Returns the write stream.
 int pclose()
           
 void print(char v)
          Prints a string to a file.
 void print(java.lang.String v)
          Prints a string to a file.
 java.lang.String toString()
          Converts to a string.
 void write(byte[] buffer, int offset, int length)
          Writes a buffer to a file.
 void write(int ch)
          Writes a character
 
Methods inherited from class com.caucho.quercus.lib.file.AbstractBinaryOutput
getPosition, getResourceType, isEOF, seek, setPosition, stat, write
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PopenOutput

public PopenOutput(Env env,
                   java.lang.Process process)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Returns the write stream.

Specified by:
getOutputStream in interface BinaryOutput
Overrides:
getOutputStream in class AbstractBinaryOutput

print

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

Specified by:
print in interface BinaryOutput
Overrides:
print in class AbstractBinaryOutput
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
Overrides:
print in class AbstractBinaryOutput
Throws:
java.io.IOException

write

public void write(int ch)
           throws java.io.IOException
Writes a character

Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Writes a buffer to a file.

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

flush

public void flush()
Flushes the output.

Specified by:
flush in interface BinaryOutput
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class AbstractBinaryOutput

closeWrite

public void closeWrite()
Closes the file.

Specified by:
closeWrite in interface BinaryOutput
Overrides:
closeWrite in class AbstractBinaryOutput

pclose

public int pclose()

close

public void close()
Closes the file.

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

cleanup

public void cleanup()
Implements the EnvCleanup interface.

Specified by:
cleanup in interface EnvCleanup

toString

public java.lang.String toString()
Converts to a string.

Overrides:
toString in class java.lang.Object
Parameters:
env -