For the latest news and information visit
The GNU Crypto project

gnu.crypto.keyring
Class MeteredInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by gnu.crypto.keyring.MeteredInputStream
All Implemented Interfaces:
Closeable

final class MeteredInputStream
extends FilterInputStream


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MeteredInputStream(InputStream in, int limit)
           
 
Method Summary
 int available()
           
 void close()
           
 boolean limitReached()
          Tests if the number of bytes read has reached the limit.
 void mark(int readLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buf)
           
 int read(byte[] buf, int off, int len)
           
 void reset()
           
 long skip(long len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeteredInputStream

MeteredInputStream(InputStream in,
                   int limit)
Method Detail

limitReached

public boolean limitReached()
Tests if the number of bytes read has reached the limit.

Returns:
True if the limit has been reached.

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException

mark

public void mark(int readLimit)
Overrides:
mark in class FilterInputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class FilterInputStream

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buf)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] buf,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class FilterInputStream
Throws:
IOException

skip

public long skip(long len)
          throws IOException
Overrides:
skip in class FilterInputStream
Throws:
IOException

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.