An OracleXmlStream
object represents a read-only stream of XML data stored in an OracleXmlType
object.
System.Object
System.MarshalByRefObject
System.Stream
System.OracleXmlStream
// C# public sealed class OracleXmlStream : IDisposable, ICloneable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
ODP.NET Version: ODP.NET for .NET Framework 2.0 or ODP.NET for .NET Framework 4
See Also:
OracleXmlStream
members are listed in the following tables.
The OracleXmlStream
constructors are listed in Table 6-12.
Table 6-12 OracleXmlStream Constructors
Constructor | Description |
---|---|
Creates an instance of an |
OracleXmlStream Static Methods
The OracleXmlStream
static methods are listed in Table 6-13.
Table 6-13 OracleXmlStream Static Methods
Methods | Description |
---|---|
|
Inherited from |
OracleXmlStream Instance Properties
The OracleXmlStream
instance properties are listed in Table 6-14.
Table 6-14 OracleXmlStream Instance Properties
Properties | Description |
---|---|
Indicates whether or not the XML stream can be read |
|
Indicates whether or not forward and backward seek operation can be performed |
|
CanWrite |
Not Supported |
Indicates the |
|
Indicates the number of bytes in the XML stream |
|
Gets or sets the byte position within the stream |
|
Returns the XML data, starting from the first character in the stream as a string |
OracleXmlStream Instance Methods
The OracleXmlStream
instance methods are listed in Table 6-15.
Table 6-15 OracleXmlStream Instance Methods
Methods | Description |
---|---|
|
Inherited from |
|
Inherited from |
Creates a copy of an |
|
Closes the current stream and releases any resources associated with it |
|
Releases resources allocated by this object |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Not Supported |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
Reads a specified amount from the current stream instance and populates the array buffer (Overloaded) |
|
|
Inherited from |
Sets the position within the current stream and returns the new position within the current stream |
|
|
Not Supported |
|
Inherited from |
|
Not Supported |
|
Not Supported |
This constructor creates an instance of an OracleXmlStream
object which provides a Stream
representation of the XML data stored in an OracleXmlType
object.
// C#
public OracleXmlStream(OracleXmlType xmlType);
xmlType
The OracleXmlType
object.
The OracleXmlStream
implicitly uses the OracleConnection
object from the OracleXmlType
object from which it was constructed.
The OracleXmlStream
static methods are listed in Table 6-16.
The OracleXmlStream
instance properties are listed in Table 6-17.
Table 6-17 OracleXmlStream Instance Properties
Properties | Description |
---|---|
Indicates whether or not the XML stream can be read |
|
Indicates whether or not forward and backward seek operation can be performed |
|
|
Not Supported |
Indicates the |
|
Indicates the number of bytes in the XML stream |
|
Gets or sets the byte position within the stream |
|
Returns the XML data, starting from the first character in the stream as a string |
Overrides Stream
This property indicates whether or not the XML stream can be read.
// C# public override bool CanRead{get;}
If the XML stream is can be read, returns true
; otherwise, returns false
.
Overrides Stream
This property indicates whether or not forward and backward seek operation can be performed.
// C# public override bool CanSeek{get;}
If forward and backward seek operations can be performed, this property returns true
. Otherwise, returns false
.
This instance property indicates the OracleConnection
that is used to retrieve the XML data.
// C# public OracleConnection Connection {get;}
An OracleConnection
.
ObjectDisposedException
- The object is already disposed.
Overrides Stream
This property indicates the number of bytes in the XML stream.
// C# public override Int64 Length{get;}
An Int64
value representing the number of bytes in the XML stream. An empty stream has a length of 0 bytes.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
Overrides Stream
This property gets or sets the byte position within the stream.
// C# public override Int64 Position{get; set;}
An Int64
that indicates the current position in the stream.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
ArgumentOutOfRangeException
- The Position
is less than 0.
The beginning of the stream is represented by position 0
. Seeking to any location beyond the length of the stream is supported.
This property returns the XML data, starting from the first character of the stream as a string.
// C# public string Value{get; set;}
A string
.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
The value of Position
is neither used nor changed by using this property.
The maximum length of the string that can be returned by this property is 2 GB.
The OracleXmlStream
instance methods are listed in Table 6-18.
Table 6-18 OracleXmlStream Instance Methods
Methods | Description |
---|---|
|
Inherited from |
|
Inherited from |
Creates a copy of an |
|
Closes the current stream and releases any resources associated with it |
|
Releases resources allocated by this object |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Not Supported |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
Reads a specified amount from the current XML stream instance and populates the array buffer (Overloaded) |
|
|
Inherited from |
Sets the position within the current stream and returns the new position within the current stream |
|
|
Not Supported |
|
Inherited from |
|
Not Supported |
|
Not Supported |
This method creates a copy of an OracleXmlStream
object.
// C# public object Clone();
An OracleXmlStream
object.
ICloneable
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
The cloned object has the same property values as that of the object being cloned.
Overrides Stream
This method closes the current stream and releases any resources associated with it.
// C# public override void Close();
This public method releases resources allocated by this object.
// C# public void Dispose();
IDisposable
The object cannot be reused after being disposed. Although some properties can still be accessed, their values cannot be accountable. Since resources are freed, method calls can lead to exceptions.
This method reads a specified amount from the current XML stream instance and populates the array buffer.
This method reads a specified amount of unicode bytes from the current instance, advances the position within the stream, and populates the byte array buffer.
This method reads a specified amount of characters from the current instance, advances the position within the stream, and populates the character array buffer.
Overrides Stream
This method reads a specified amount of unicode bytes from the current instance, advances the position within the stream, and populates the byte array buffer.
// C# public override int Read(byte[ ] buffer, int offset, int count);
buffer
The byte array buffer that is populated.
offset
The zero-based offset (in bytes) at which the buffer is populated.
count
The maximum amount of bytes to be read.
The number of unicode bytes read into the given byte[]
buffer or 0
if the end of the stream has been reached.
This method reads a maximum of count
bytes from the current stream and stores them in buffer beginning at offset
. The current position within the stream is advanced by the number of bytes read. However, if an exception occurs, the current position within the stream remains unchanged.
The XML data is read starting from the position specified by the Position
property.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
Overrides Stream
This method reads a specified amount of characters from the current instance, advances the position within the stream, and populates the character array buffer.
// C# public override int Read(char[ ] buffer, int offset, int count);
buffer
The character array buffer to be populated.
offset
The zero-based offset (in characters) in the buffer at which the buffer is populated.
count
The maximum amount of characters to be read from the stream.
The return value indicates the number of characters read from the stream or 0
if the end of the stream has been reached.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object.
This method requires that the Position
on the stream instance be zero or an even number.
The XML data is read starting from the position specified by the Position
property.
Overrides Stream
.
This method sets the position within the current stream and returns the new position within the current stream.
// C# public long Seek(long offset, SeekOrigin origin);
offset
A byte offset relative to origin.
If offset
is negative, the new position precedes the position specified by origin
by the number of bytes specified by offset
.
If offset is zero, the new position is the position specified by origin
.
If offset
is positive, the new position follows the position specified by origin
by the number of bytes specified by offset
.
origin
A value of type SeekOrigin
indicating the reference point used to obtain the new position.
The new Position
within the current stream.
ObjectDisposedException
- The object is already disposed.
InvalidOperationException
- The OracleConnection
is not open or has been closed during the lifetime of the object
Use the CanSeek
property to determine whether or not the current instance supports seeking. Seeking to any location beyond the length of the stream is supported.