public byte[] reset(byte[] data){
  byte[] bytes=null;
  if ((data[1] & 0xFF) < 128) {
    bytes=new byte[data[1] + 2];
    System.arraycopy(data,0,bytes,0,data[1] + 2);
  }
 else {
    if ((data[1] & 0xFF) > 128) {
      int len=data[1] & (byte)0x7F;
      int result=0;
      for (int i=0; i < len; i++) {
        result|=(data[i + 2] & 0xFF) << (8 * (len - i - 1));
      }
      bytes=new byte[result + len + 2];
      System.arraycopy(data,0,bytes,0,result + len + 2);
    }
  }
  return bytes;
}

public byte [ ] reset ( byte [ ] data ) { byte [ ] bytes = null ; if ( ( data [ 1 ] & 0xFF ) < 128 ) { bytes = new byte [ data [ 1 ] + 2 ] ; System . arraycopy ( data , 0 , bytes , 0 , data [ 1 ] + 2 ) ; } else { if ( ( data [ 1 ] & 0xFF ) > 128 ) { int len = data [ 1 ] & ( byte ) 0x7F ; int result = 0 ; for ( int i = 0 ; i < len ; i ++ ) { result |= ( data [ i + 2 ] & 0xFF ) << ( 8 * ( len - i - 1 ) ) ; } bytes = new byte [ result + len + 2 ] ; System . arraycopy ( data , 0 , bytes , 0 , result + len + 2 ) ; } } return bytes ; }
reset asn . 1 data stream after decryption , remove redundant bytes .
