UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.io
Class CountInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--edu.berkeley.guir.lib.io.CountInputStream

public class CountInputStream
extends InputStream

An InputStream that counts how many characters go through it. There currently seems to be a JIT error when calling read(byte[]).

This software is distributed under the Berkeley Software License.

 Revisions:  - GUIRLib-v1.0-1.0.0, Jun 23 1998, JH
               Created class
             - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
               Touched for GUIRLib release
 

Since:
JDK 1.1.6
Version:
GUIRLib-v1.4-1.0.0, Aug 31 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

Constructor Summary
CountInputStream(InputStream istream)
          Wrap a CountInputStream around the specified InputStream.
 
Method Summary
 int available()
           
 void close()
           
 long getNumberOfBytes()
          Get the number of bytes gone through this stream.
static void main(String[] argv)
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 void resetNumberOfBytes()
          Resets the number of bytes processed through this stream to 0.
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountInputStream

public CountInputStream(InputStream istream)
Wrap a CountInputStream around the specified InputStream.
Method Detail

available

public int available()
              throws IOException
Overrides:
available in class InputStream

close

public void close()
           throws IOException
Overrides:
close in class InputStream

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

read

public int read()
         throws IOException
Overrides:
read in class InputStream

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream

read

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

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream

getNumberOfBytes

public long getNumberOfBytes()
Get the number of bytes gone through this stream.
Parameters:
a - long containing the number of bytes processed through this stream.

resetNumberOfBytes

public void resetNumberOfBytes()
Resets the number of bytes processed through this stream to 0.

main

public static void main(String[] argv)
                 throws IOException

Copyright Information