home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / samples.z / BaseServletStream.java < prev    next >
Text File  |  1996-12-09  |  2KB  |  68 lines

  1. /*
  2.  * BaseServletStream.java
  3.  *
  4.  *
  5.  * Copyright 1996 Sybase, Inc. All rights reserved.
  6.  */
  7.  
  8. import java.io.*;
  9.  
  10. /**
  11.  * The BaseServletStream class provides an output stream for Java 
  12.  * servlet to write to the document from which it is invoked.
  13.  */
  14.  
  15.  
  16. public class BaseServletStream extends OutputStream
  17. //*************************************************
  18. {
  19.  
  20.     //-------------------------------------------------------------
  21.     // Constructor
  22.     //-------------------------------------------------------------
  23.  
  24.     /**
  25.      * Constructs a new BaseServletStream object with the 
  26.      * specified document
  27.      */
  28.      
  29.     public BaseServletStream( Document document )
  30.     //*******************************************
  31.     {
  32.         this._document = document;        
  33.     }
  34.     
  35.     
  36.     //-------------------------------------------------------------
  37.     // Public Methods
  38.     //-------------------------------------------------------------
  39.  
  40.     /**
  41.      * Write a single byte to the document
  42.      * @param b byte to write
  43.      * @exception IOException If the document is invalid
  44.      */
  45.  
  46.     public native void write( int b ) throws IOException;
  47.     //**************************************************    
  48.     
  49.  
  50.     /**
  51.      * Write an array of bytes to the document
  52.      * @param b[] array of bytes to be written
  53.      * @param off start offset in the data array
  54.      * @param len number of byte written
  55.      * @exception IOException If I/O error has occurred
  56.      */
  57.      
  58.     public native void writeBytes(byte b[], int off, int len) throws IOException;
  59.     //**************************************************************************
  60.     
  61.     //-------------------------------------------------------------
  62.     // Data
  63.     //-------------------------------------------------------------
  64.     
  65.     private Document _document;         // document object where stream outputs to
  66.     
  67. }
  68.