pasn.misc.encoding
Class DefiniteLengthInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by pasn.encoding.ASN1InputStream
              extended by pasn.misc.encoding.DefiniteLengthInputStream
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
BERInputStream, CERInputStream, DERInputStream

public abstract class DefiniteLengthInputStream
extends ASN1InputStream

Author:
ncottin

Field Summary
 
Fields inherited from class pasn.encoding.ASN1InputStream
DELAY_UNIT, NO_DELAY
 
Constructor Summary
DefiniteLengthInputStream(java.io.File src, ASN1ValueDecoder decoder)
           
DefiniteLengthInputStream(java.io.File src, ASN1ValueDecoder decoder, long maxLength)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder, boolean extraAllowed)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder, long maxLength)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder, long maxLength, boolean extraAllowed)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder, long maxLength, long startIndex, boolean extraAllowed)
           
DefiniteLengthInputStream(java.io.InputStream in, ASN1ValueDecoder decoder, long maxLength, long startIndex, boolean extraAllowed, long delay, long delayUnit)
           
DefiniteLengthInputStream(java.lang.String srcPath, ASN1ValueDecoder decoder)
           
DefiniteLengthInputStream(java.lang.String srcPath, ASN1ValueDecoder decoder, long maxLength)
           
 
Method Summary
 ASN1DecodedObject decodeDefiniteLength(int tag, ASN1Class asnClass, long length, boolean primitive, boolean tagged)
           
static ASN1Class getASN1Class(int encodedTag)
           
 ASN1InputStream getInstance(java.io.InputStream in, long length, long startIndex)
           
abstract  ASN1InputStream getInstance(java.io.InputStream in, long length, long startIndex, boolean extraAllowed)
           
 long getLengthIndex()
           
 long getValueIndex()
           
 boolean isIndefiniteLength()
           
 boolean isPrimitive(int encodedTag)
           
 long readLength(boolean allowIndefiniteLength)
           
 int readTag(int encodedTag)
           
 void setIndefiniteLength(boolean indefiniteLength)
           
 void setLengthIndex(long lengthIndex)
           
 void setValueIndex(long valueIndex)
           
 
Methods inherited from class pasn.encoding.ASN1InputStream
decode, getDecoder, getDelay, getDelayUnit, getInputStream, getMaxLength, getReadLength, getStartIndex, isDelayed, isExtraAllowed, isLengthConstrained, readByte, readByte, setDelay, setExtraAllowed, setInputStream, setMaxLength
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder)
Parameters:
in -
decoder -

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder,
                                 boolean extraAllowed)

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder,
                                 long maxLength)

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder,
                                 long maxLength,
                                 boolean extraAllowed)

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder,
                                 long maxLength,
                                 long startIndex,
                                 boolean extraAllowed)

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.InputStream in,
                                 ASN1ValueDecoder decoder,
                                 long maxLength,
                                 long startIndex,
                                 boolean extraAllowed,
                                 long delay,
                                 long delayUnit)

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.File src,
                                 ASN1ValueDecoder decoder)
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.lang.String srcPath,
                                 ASN1ValueDecoder decoder)
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.io.File src,
                                 ASN1ValueDecoder decoder,
                                 long maxLength)
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

DefiniteLengthInputStream

public DefiniteLengthInputStream(java.lang.String srcPath,
                                 ASN1ValueDecoder decoder,
                                 long maxLength)
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

decodeDefiniteLength

public final ASN1DecodedObject decodeDefiniteLength(int tag,
                                                    ASN1Class asnClass,
                                                    long length,
                                                    boolean primitive,
                                                    boolean tagged)
                                             throws java.io.IOException,
                                                    ASN1DecodingException,
                                                    EndOfContentFoundException,
                                                    ASN1SecurityException,
                                                    ASN1TimerException
Throws:
java.io.IOException
ASN1DecodingException
EndOfContentFoundException
ASN1SecurityException
ASN1TimerException

getInstance

public final ASN1InputStream getInstance(java.io.InputStream in,
                                         long length,
                                         long startIndex)

getInstance

public abstract ASN1InputStream getInstance(java.io.InputStream in,
                                            long length,
                                            long startIndex,
                                            boolean extraAllowed)

readTag

public final int readTag(int encodedTag)
                  throws java.io.IOException,
                         ASN1DecodingException,
                         ASN1SecurityException,
                         ASN1TimerException
Throws:
java.io.IOException
ASN1DecodingException
ASN1SecurityException
ASN1TimerException

readLength

public final long readLength(boolean allowIndefiniteLength)
                      throws java.io.IOException,
                             ASN1DecodingException,
                             ASN1SecurityException,
                             ASN1TimerException
Throws:
java.io.IOException
ASN1DecodingException
ASN1SecurityException
ASN1TimerException

getASN1Class

public static final ASN1Class getASN1Class(int encodedTag)
                                    throws ASN1DecodingException
Throws:
ASN1DecodingException

isPrimitive

public final boolean isPrimitive(int encodedTag)

setLengthIndex

public final void setLengthIndex(long lengthIndex)

getLengthIndex

public final long getLengthIndex()

setIndefiniteLength

public final void setIndefiniteLength(boolean indefiniteLength)

isIndefiniteLength

public final boolean isIndefiniteLength()

setValueIndex

public final void setValueIndex(long valueIndex)

getValueIndex

public final long getValueIndex()