SetLength() public method

When overridden in a derived class, sets the length of the current stream.
The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
return void
コード例 #1
0
ファイル: PipeStreamTest.cs プロジェクト: pecegit/sshnet
 public void SetLengthTest()
 {
     PipeStream target = new PipeStream(); // TODO: Initialize to an appropriate value
     long value = 0; // TODO: Initialize to an appropriate value
     target.SetLength(value);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
コード例 #2
0
ファイル: PipeStreamTest.cs プロジェクト: sshnet/SSH.NET
        public void SetLengthShouldThrowNotSupportedException()
        {
            var target = new PipeStream();

            try
            {
                target.SetLength(1);
                Assert.Fail();
            }
            catch (NotSupportedException)
            {
            }
        }