public override void SetLength(long value) { if (value > int.MaxValue) { throw new IndexOutOfRangeException("CSharpStream溢出"); } if (value < 0) { throw new IndexOutOfRangeException("CSharpStream下溢"); } int newlen = (int)value; int newwritelen = newlen - _bytestream.Length; if (newwritelen > 0) { _bytestream.EnsureWritable(newwritelen); _bytestream.SetWriterIndex(newlen); } }
public IByteStream EnsureWritable(int newWriteBytes) { return(_stream.EnsureWritable(newWriteBytes)); }