home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / UseTableStream.java < prev    next >
Text File  |  1997-10-25  |  1KB  |  43 lines

  1. /**
  2.  * UseTableStream: Hook up the HTMLTableStream object to the Framework's Response
  3.  * object, which is an OutputStream.
  4.  */
  5.  
  6. package IISSample;
  7.  
  8. import java.io.*;
  9. import aspcomp.*;
  10.  
  11.  
  12. public class UseTableStream 
  13. {
  14.  
  15.     static byte[] byteArray = {
  16.             (byte)'1', (byte)' ', (byte)'2', (byte)' ', (byte)'3', 
  17.             (byte)' ', (byte)'4', (byte)' ', (byte)'\n', (byte)' ', 
  18.             (byte)'5', (byte)' ', (byte)'6', (byte)' ', (byte)'7', 
  19.             (byte)' ', (byte)'8', (byte)' ', (byte)'\n', (byte) ' ',
  20.             (byte)'9', (byte)' ', (byte)'1', (byte)'0', (byte)' ', 
  21.             (byte)'1', (byte)'1', (byte)' ', (byte)'1', (byte)'2', 
  22.             (byte) ' ',(byte) '\n'
  23.     };
  24.  
  25.     // Create a byte stream, and use it as input to the HTML table stream processor
  26.     public void makeTable()
  27.     {
  28.         Response response = AspContext.getResponse();
  29.  
  30.         ByteArrayInputStream inputStream = new ByteArrayInputStream(byteArray);
  31.  
  32.         HTMLTableStream ts = new HTMLTableStream(inputStream);
  33.  
  34.         ts.setCols(4);
  35.         ts.setBorderWidth(2);
  36.         ts.setCellSpacing(3);
  37.         ts.setBorderColor("Green");
  38.  
  39.         ts.OutputTable(response);
  40.     }
  41.  
  42. }
  43.