FileDocCategorySizeDatePackage
LimitedInputStream.javaAPI DocBouncy Castle Crypto API 1.41 (Java 1.5)887Wed Oct 01 10:55:28 BST 2008org.bouncycastle.sasn1

LimitedInputStream

public abstract class LimitedInputStream extends InputStream

Fields Summary
protected final InputStream
_in
Constructors Summary
LimitedInputStream(InputStream in)

         this._in = in;
    
Methods Summary
java.io.InputStreamgetUnderlyingStream()

        return _in;
    
protected voidsetParentEofDetect(boolean on)

        if (_in instanceof IndefiniteLengthInputStream)
        {
            ((IndefiniteLengthInputStream)_in).setEofOn00(on);
        }
    
byte[]toByteArray()

        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        
        int b = 0;
        while ((b = this.read()) >= 0)
        {
            bOut.write(b);
        }
        
        return bOut.toByteArray();