com.cometway.httpd
Class HTTPDecoderStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.cometway.httpd.HTTPDecoderStream
All Implemented Interfaces:
java.io.Closeable

public class HTTPDecoderStream
extends java.io.InputStream

This extension of InputStream allows only a fixed number of bytes to be read from the stream before acting as the Stream is empty. The bytes that are read from this stream are automatically decoded via HTTP parameter decoding.


Field Summary
protected  int count
           
protected  int dataLength
           
 boolean decodePlusSign
           
protected  java.io.InputStream sourceStream
           
 
Constructor Summary
HTTPDecoderStream(java.io.InputStream source)
           
HTTPDecoderStream(java.io.InputStream source, int length)
           
 
Method Summary
 int available()
           
 void close()
           
static void main(java.lang.String[] args)
           
 void mark(int i)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buffer)
           
 int read(byte[] buffer, int start, int length)
           
 void reset()
           
 long skip(long i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceStream

protected java.io.InputStream sourceStream

dataLength

protected int dataLength

count

protected int count

decodePlusSign

public boolean decodePlusSign
Constructor Detail

HTTPDecoderStream

public HTTPDecoderStream(java.io.InputStream source)
                  throws java.io.IOException
Throws:
java.io.IOException

HTTPDecoderStream

public HTTPDecoderStream(java.io.InputStream source,
                         int length)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

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[] buffer)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] buffer,
                int start,
                int length)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long i)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

available

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

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

mark

public void mark(int i)
Overrides:
mark in class java.io.InputStream

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.InputStream

main

public static void main(java.lang.String[] args)