net.sourceforge.jtds.util
Class KnownLengthInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--net.sourceforge.jtds.util.KnownLengthInputStream

public class KnownLengthInputStream
extends java.io.FilterInputStream

An input stream that will continue to read until the expected number of bytes has been read.

Version:
$Id: KnownLengthInputStream.java,v 1.1 2005/01/04 17:13:04 alin_sinpalean Exp $
Author:
Rob Worsnop

Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from class java.io.InputStream
SKIP_BUFFER_SIZE, skipBuffer
 
Constructor Summary
KnownLengthInputStream(java.io.InputStream in)
          Constructs an object around an existing stream.
 
Method Summary
 int read(byte[] b, int off, int len)
          Reads exactly len bytes from the stream.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

KnownLengthInputStream

public KnownLengthInputStream(java.io.InputStream in)
Constructs an object around an existing stream.
Parameters:
in - the existing stream
Method Detail

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads exactly len bytes from the stream.
Overrides:
read in class java.io.FilterInputStream
Parameters:
b - the buffer to hold the read bytes
off - the offset within the buffer
len - the number of bytes to read
Returns:
the number of bytes read (always same as len)


Generated on April 15 2005