public BerInputStream(InputStream in,int initialSize) throws IOException {
  this.in=in;
  buffer=new byte[initialSize];
  next();
  if (length != INDEFINIT_LENGTH) {
    if (buffer.length < (length + offset)) {
      byte[] newBuffer=new byte[length + offset];
      System.arraycopy(buffer,0,newBuffer,0,offset);
      buffer=newBuffer;
    }
  }
 else {
    isIndefinedLength=true;
    throw new ASN1Exception("Decoding indefinite length encoding is not supported");
  }
}

public BerInputStream ( InputStream in , int initialSize ) throws IOException { this . in = in ; buffer = new byte [ initialSize ] ; next ( ) ; if ( length != INDEFINIT_LENGTH ) { if ( buffer . length < ( length + offset ) ) { byte [ ] newBuffer = new byte [ length + offset ] ; System . arraycopy ( buffer , 0 , newBuffer , 0 , offset ) ; buffer = newBuffer ; } } else { isIndefinedLength = true ; throw new ASN1Exception ( "Decoding indefinite length encoding is not supported" ) ; } }
creates stream for decoding .
