Class CappedStream
Represents a capped stream that can only be used along a given region.
Inheritance
System.Object
System.MarshalByRefObject
System.IO.Stream
CappedStream
Implements
System.IDisposable
Inherited Members
System.IO.Stream.Null
System.IO.Stream.BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.Close()
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.Dispose()
System.IO.Stream.Dispose(System.Boolean)
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.ReadByte()
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.WriteByte(System.Byte)
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.IO.Mapped.Streams
Assembly: Mars.IO.dll
Syntax
public class CappedStream : Stream, IDisposable
Constructors
| Improve this Doc View SourceCappedStream(Stream, Int64, Int64)
Creates a new capped stream.
Declaration
public CappedStream(Stream stream, long offset, long length)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Int64 | offset | |
System.Int64 | length |
Properties
| Improve this Doc View SourceCanRead
Gets a value indicating whether the current stream supports reading.
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
System.IO.Stream.CanRead
|
Improve this Doc
View Source
CanSeek
Gets a value indicating whether the current stream supports seeking.
Declaration
public override bool CanSeek { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
System.IO.Stream.CanSeek
|
Improve this Doc
View Source
CanWrite
Gets a value indicating whether the current stream supports writing.
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
System.IO.Stream.CanWrite
|
Improve this Doc
View Source
Length
Returns the current length of this stream.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
System.IO.Stream.Length
|
Improve this Doc
View Source
Position
Gets/sets the current position.
Declaration
public override long Position { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
System.IO.Stream.Position
Methods
| Improve this Doc View SourceFlush()
Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
Declaration
public override void Flush()
Overrides
System.IO.Stream.Flush()
|
Improve this Doc
View Source
Read(Byte[], Int32, Int32)
Reads a sequence of bytes from the current
stream and advances the position within the stream by the number of bytes
read.
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | offset | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.IO.Stream.Read(System.Byte[], System.Int32, System.Int32)
|
Improve this Doc
View Source
Seek(Int64, SeekOrigin)
Sets the position within the current
stream.
Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | offset | |
System.IO.SeekOrigin | origin |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
System.IO.Stream.Seek(System.Int64, System.IO.SeekOrigin)
|
Improve this Doc
View Source
SetLength(Int64)
Sets the length of the current stream.
Declaration
public override void SetLength(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value |
Overrides
System.IO.Stream.SetLength(System.Int64)
|
Improve this Doc
View Source
Write(Byte[], Int32, Int32)
Writes a sequence of bytes to the current
stream and advances the current position within this stream by the number
of bytes written.
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | offset | |
System.Int32 | count |
Overrides
System.IO.Stream.Write(System.Byte[], System.Int32, System.Int32)
Implements
System.IDisposable