ASN1C C# Runtime Library
7.8
|
Public Member Functions | |
Asn1OutputStream (System.IO.Stream os) | |
override void | Close () |
override void | Flush () |
override int | Read (byte[] buffer, int offset, int count) |
override long | Seek (long offset, System.IO.SeekOrigin origin) |
override void | SetLength (long value) |
virtual void | Write (byte[] b) |
override void | Write (System.Byte[] b, int off, int len) |
void | Write2Bytes (int value) |
void | Write4Bytes (int value) |
virtual void | WriteByte (int b) |
override void | WriteByte (byte b) |
Public Member Functions inherited from Asn1Writable | |
void | Write (byte[] b, int off, int len) |
Properties | |
override bool | CanRead [get] |
override bool | CanSeek [get] |
override bool | CanWrite [get] |
Asn1Context | Context [get] |
override long | Length [get] |
override long | Position [get, set] |
This abstract class implements the base output stream to encode ASN.1 messages.
Asn1OutputStream | ( | System.IO.Stream | os | ) |
This constructor creates an output stream object.
os | The underlying System.IO.Stream object. |
override void Close | ( | ) |
Closes this output stream and releases any system resources associated with this stream. The general contract of close
is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.
System.IO.IOException | An error occurred while trying to close the stream. |
override void Flush | ( | ) |
Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush
is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.
System.IO.IOException | An I/O error occurs. |
System.ObjectDisposedException | The stream is closed. |
override int Read | ( | byte [] | buffer, |
int | offset, | ||
int | count | ||
) |
This method always throws NotSupportedException. Asn1OutputStream doesn't support reading.
buffer | When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. |
offset | The byte offset in array at which to begin reading. |
count | The maximum number of bytes to read. |
System.NotSupportedException | The stream does not support reading. |
override long Seek | ( | long | offset, |
System.IO.SeekOrigin | origin | ||
) |
Sets the current position of this stream to the given value.
offset | The point relative to origin from which to begin seeking. |
origin | Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin. |
System.IO.IOException | An I/O error occurs. |
System.NotSupportedException | The stream does not support seeking, such as if the FileStream is constructed from a pipe or console output. |
System.ArgumentException | Attempted seeking before the beginning of the stream. |
System.ObjectDisposedException | Methods were called after the stream was closed. |
override void SetLength | ( | long | value | ) |
Sets the length of this stream to the given value.
value | The new length of the stream. |
System.IO.IOException | An I/O error has occurred. |
System.NotSupportedException | The stream does not support both writing and seeking. |
System.ArgumentOutOfRangeException | Attempted to set the value parameter to less than 0. |
|
virtual |
Writes b.length
bytes from the specified byte array to this output stream. The general contract for write(b)
is that it should have exactly the same effect as the call Write(b, 0, b.length)
.
b | the data. |
System.ArgumentNullException | array is a null reference |
System.ArgumentException | offset and count describe an invalid range in array. |
System.ArgumentOutOfRangeException | offset or count is negative. |
System.IO.IOException | An I/O error occurs. |
System.ObjectDisposedException | The stream is closed. |
System.NotSupportedException | The current stream instance does not support writing. |
Implements Asn1Writable.
Reimplemented in Asn1PerOutputStream.
Referenced by Asn1Real10.ConvertToDecimal(), Asn1BigInteger.DecodeXML(), Asn1UTF8String.Encode(), Asn1OctetString.Encode(), Asn1Real10.Encode(), Asn1BitString.Encode(), and Asn1OpenType.ToString().
override void Write | ( | System.Byte [] | b, |
int | off, | ||
int | len | ||
) |
Writes len
bytes from the specified byte array starting at offset off
to this output stream.
b | The byte array data to be written. |
off | The offset in array at which to begin write. |
len | the number of bytes to write. |
System.ArgumentNullException | array is a null reference |
System.ArgumentException | offset and count describe an invalid range in array. |
System.ArgumentOutOfRangeException | offset or count is negative. |
System.IO.IOException | An I/O error occurs. |
System.ObjectDisposedException | The stream is closed. |
System.NotSupportedException | The current stream instance does not support writing. |
void Write2Bytes | ( | int | value | ) |
Write the lowest two bytes of value to the output stream. The lowest byte is written last.
value |
Referenced by Asn1OctetString.Encode(), and Asn1Integer.Encode16Bit().
void Write4Bytes | ( | int | value | ) |
Write the four bytes of value to the output stream. The lowest byte is written last.
value |
Referenced by Asn1Integer.Encode32Bit().
|
virtual |
Writes the specified byte to this output stream. The general contract for Write
is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b
. The 24 high-order bits of b
are ignored.
b | the byte . |
System.ObjectDisposedException | The stream is closed. |
System.NotSupportedException | The stream does not support writing. |
Implements Asn1Writable.
Reimplemented in Asn1PerOutputStream.
Referenced by Asn1Real10.ConvertToDecimal(), Asn1Real10.Encode(), Asn1Integer.Encode(), Asn1Real.NormalizedRealValueToString(), and Asn1Boolean.ToString().
override void WriteByte | ( | byte | b | ) |
Writes the specified byte to this output stream. The general contract for Write
is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b
. The 24 high-order bits of b
are ignored.
b | the byte . |
System.ObjectDisposedException | The stream is closed. |
System.NotSupportedException | The stream does not support writing. |
|
get |
Gets a value indicating whether the current stream supports reading.
Value:
false, the stream doesn't supports reading.
|
get |
Gets a value indicating whether the current stream supports seeking.
Value:
true if the stream supports seeking; otherwise, false.
|
get |
Gets a value indicating whether the current stream supports writing.
Value:
true if the stream supports writing; otherwise, false.
|
get |
The context associated with this output stream.
|
get |
Gets the length in bytes of the stream.
Value:
A long value representing the length of the stream in bytes.
System.NotSupportedException | CanSeek for this stream is false. |
System.IO.IOException | An I/O error occurs, such as the file being closed. |
|
getset |
Gets or sets the current position of this stream.
Value:
The current position of this stream.
System.NotSupportedException | The stream does not support seeking. |
System.IO.IOException | An I/O error occurs. |
System.ArgumentOutOfRangeException | Attempted to set the position to a negative value. |
System.IO.EndOfStreamException | Attempted seeking past the end of a stream that does not support this. |