Asn1SeekableStream Class Reference

List of all members.

Public Member Functions

 Asn1SeekableStream (System.IO.Stream istream, int bufsize)
override void Close ()
override void Flush ()
override int Read (byte[] buffer, int offset, int count)
override int ReadByte ()
override void SetLength (long len)

Protected Member Functions

override void Dispose (bool disposing)

Properties

override bool CanRead [get]
override bool CanSeek [get]
bool IsValid [get]
override long Position [get, set]

Detailed Description

This class is a wrapper that buffers the given input stream, allowing seek operations on streams that normally wouldn't support them. This class is only available inside the ASN.1 runtime.


Constructor & Destructor Documentation

Asn1SeekableStream ( System.IO.Stream  istream,
int  bufsize 
)

Creates the seekable stream.

Parameters:
istream The underlying stream.
bufsize The size of the capture buffer.

Member Function Documentation

override void Close (  ) 

Closes the underlying stream.

override void Dispose ( bool  disposing  )  [protected]

Disposes of the stream.

override void Flush (  ) 

Flushes the underlying stream.

override int Read ( byte[]  buffer,
int  offset,
int  count 
)

This method reads bytes from the underlying input stream, updating the underlying buffer and copying out the bytes into the given buffer.

Parameters:
buffer The byte buffer to receive the read bytes.
offset The offset in the buffer to begin writing the read bytes.
count The number of bytes to read.
Returns:
Number of bytes read from the stream.
override int ReadByte (  ) 

Reads a byte from the underlying stream.

Returns:
The byte, cast to an int; -1 if no data was read.
override void SetLength ( long  len  ) 

This will set the length of the underlying stream.

Parameters:
len 

Property Documentation

override bool CanRead [get]

The CanRead property returns true under all circumstances. If the underyling buffer would overflow when reading, we wrap around. The buffer is temporary storage.

override bool CanSeek [get]

This stream can always seek.

bool IsValid [get]

Tells whether or not the stream is valid for seeking. When reading from the stream, the amount read may exceed the size of the underlying buffer. The Read will still

override long Position [get, set]

Returns the current position of the stream. The current position may also be set using this attribute (e.g., for Mark or Reset).