com.sapportals.wcm.util.mmparser

Class MMInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.sapportals.wcm.util.mmparser.MMInputStream

public class MMInputStream
extends FilterInputStream

This class implements a readLine Method for a byte stream.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MMInputStream(InputStream in)
          Creates a BufferedServletInputStream that wraps the provided ServletInputStream .
 
Method Summary
 int read()
          Implement buffering on top of the read method of the wrapped ServletInputStream .
 int read(byte[] b, int off, int len)
          Implement buffering on top of the read method of the wrapped ServletInputStream .
 int readLine(byte[] b, int off, int len)
          Implement buffering on top of the readLine method of the wrapped ServletInputStream .
 
Methods inherited from class java.io.FilterInputStream
available, 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

MMInputStream

public MMInputStream(InputStream in)
Creates a BufferedServletInputStream that wraps the provided ServletInputStream .

Parameters:
in - a servlet input stream.
Method Detail

readLine

public int readLine(byte[] b,
                    int off,
                    int len)
             throws IOException
Implement buffering on top of the readLine method of the wrapped ServletInputStream .

Parameters:
b - an array of bytes into which data is read.
off - an integer specifying the character at which this method begins reading.
len - an integer specifying the maximum number of bytes to read.
Returns:
an integer specifying the actual number of bytes read, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.

read

public int read()
         throws IOException
Implement buffering on top of the read method of the wrapped ServletInputStream .

Returns:
the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Implement buffering on top of the read method of the wrapped ServletInputStream .

Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Throws:
IOException - if an I/O error occurs.


Copyright 2006 SAP AG Complete Copyright Notice