BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.jdbc.informix4
Class SimpleOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--weblogic.jdbc.informix4.SimpleOutputStream

public class SimpleOutputStream
extends java.io.OutputStream

Author:
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Field Summary
protected  java.io.OutputStream stream
           
 
Method Summary
 void close()
           
 void flush()
          public void writeLengthNStream(InputStream stream) throws java.io.IOException { byte theBuffer [] = new byte[4096]; // create 4K buffer writeShort(stream.available()); // write the length available for(int len = 0 ; len != -1 ; ) // keep passing data until source stream is exausted { len = stream.read(theBuffer); // read up to 4K from source stream if(len > 0) write(theBuffer,0,len); // write to destination stream (this) } }
 boolean isClosed()
           
 void terminate()
           
 void terminateStatement(byte[] inTrailer)
           
 void write(int b)
           
 void writeAsBigPascalString(java.lang.String string)
          public void writeString(String string) throws IOException { int len = string.length(); // string length byte bytes [] = new byte[len]; // create buffer for the string string.getBytes(0,len,bytes,0); // copy the string into the array of bytes write(bytes); // write to the stream }
 void writeLsbInt(int value)
           
 void writeShort(int theShort)
           
 void writeStream(java.io.InputStream stream)
          public void writeAsPascalString(String string) throws IOException { int len = Math.min(255,string.length()); // string length byte bytes [] = new byte[len]; // create buffer for the string string.getBytes(0,len,bytes,0); // copy the string into the array of bytes write((byte)len); // write the length byte write(bytes); // write to the stream }
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected java.io.OutputStream stream
Method Detail

write

public void write(int b)
           throws java.io.IOException

Overrides:
write in class java.io.OutputStream

close

public void close()
           throws java.io.IOException

Overrides:
close in class java.io.OutputStream

isClosed

public boolean isClosed()
                 throws java.io.IOException

writeLsbInt

public void writeLsbInt(int value)
                 throws java.io.IOException

writeAsBigPascalString

public void writeAsBigPascalString(java.lang.String string)
                            throws java.io.IOException
public void writeString(String string) throws IOException { int len = string.length(); // string length byte bytes [] = new byte[len]; // create buffer for the string string.getBytes(0,len,bytes,0); // copy the string into the array of bytes write(bytes); // write to the stream }

writeShort

public void writeShort(int theShort)
                throws java.io.IOException

writeStream

public void writeStream(java.io.InputStream stream)
                 throws java.io.IOException
public void writeAsPascalString(String string) throws IOException { int len = Math.min(255,string.length()); // string length byte bytes [] = new byte[len]; // create buffer for the string string.getBytes(0,len,bytes,0); // copy the string into the array of bytes write((byte)len); // write the length byte write(bytes); // write to the stream }

flush

public void flush()
           throws java.io.IOException
public void writeLengthNStream(InputStream stream) throws java.io.IOException { byte theBuffer [] = new byte[4096]; // create 4K buffer writeShort(stream.available()); // write the length available for(int len = 0 ; len != -1 ; ) // keep passing data until source stream is exausted { len = stream.read(theBuffer); // read up to 4K from source stream if(len > 0) write(theBuffer,0,len); // write to destination stream (this) } }

Overrides:
flush in class java.io.OutputStream

terminate

public void terminate()
               throws java.io.IOException

terminateStatement

public void terminateStatement(byte[] inTrailer)
                        throws java.io.IOException

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.