Example #1
0
    public void CloseInput()
    {
      MemoryStream ms = new MemoryStream();
      BsonReader reader = new BsonReader(ms);

      Assert.IsTrue(ms.CanRead);
      reader.Close();
      Assert.IsFalse(ms.CanRead);

      ms = new MemoryStream();
      reader = new BsonReader(ms) { CloseInput = false };

      Assert.IsTrue(ms.CanRead);
      reader.Close();
      Assert.IsTrue(ms.CanRead);
    }