winstone
Class WinstoneInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by javax.servlet.ServletInputStream
          extended by winstone.WinstoneInputStream
All Implemented Interfaces:
java.io.Closeable

public class WinstoneInputStream
extends ServletInputStream

The request stream management class.

Version:
$Id: WinstoneInputStream.java,v 1.4 2006/02/28 07:32:47 rickknowles Exp $
Author:
Rick Knowles

Constructor Summary
WinstoneInputStream(byte[] inData)
           
WinstoneInputStream(java.io.InputStream inData)
          Constructor
 
Method Summary
 int available()
           
 void finishRequest()
           
 java.io.InputStream getRawInputStream()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 int readAsMuchAsPossible(byte[] buf, int offset, int len)
          Reads like DataInputStream.readFully(byte[], int, int), except EOF before fully reading it won't result in an exception.
 byte[] readLine()
          Wrapper for the servletInputStream's readline method
 void setContentLength(int length)
           
 
Methods inherited from class javax.servlet.ServletInputStream
readLine
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinstoneInputStream

public WinstoneInputStream(java.io.InputStream inData)
Constructor


WinstoneInputStream

public WinstoneInputStream(byte[] inData)
Method Detail

getRawInputStream

public java.io.InputStream getRawInputStream()

setContentLength

public void setContentLength(int length)

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

readAsMuchAsPossible

public int readAsMuchAsPossible(byte[] buf,
                                int offset,
                                int len)
                         throws java.io.IOException
Reads like DataInputStream.readFully(byte[], int, int), except EOF before fully reading it won't result in an exception.

Returns:
number of bytes read.
Throws:
java.io.IOException

finishRequest

public void finishRequest()

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

readLine

public byte[] readLine()
                throws java.io.IOException
Wrapper for the servletInputStream's readline method

Throws:
java.io.IOException


Copyright © 2013. All Rights Reserved.