/**
  * @param expectedFirstInt expected value of the first int read from the decrypted stream
  */
 public StreamTester(MockStream ms, String keyDigestHex, int expectedFirstInt)
 {
     _ms = ms;
     byte[] keyDigest = HexRead.ReadFromString(keyDigestHex);
     _bds = new Biff8DecryptingStream(_ms, 0, new Biff8EncryptionKey(keyDigest));
     Assert.AreEqual(expectedFirstInt, _bds.ReadInt());
     _errorsOccurred = false;
 }
Beispiel #2
0
 public RecordInputStream(Stream in1, Biff8EncryptionKey key, int initialOffset)
 {
     if (key == null)
     {
         _dataInput = SimpleHeaderInput.GetLEI(in1);
         _bhi = new SimpleHeaderInput(in1);
     }
     else
     {
         Biff8DecryptingStream bds = new Biff8DecryptingStream(in1, initialOffset, key);
         _bhi = bds;
         _dataInput = bds;
     }
     _nextSid = ReadNextSid();
 }