| Oracle Data Provider for .NET Developer's Guide Release 9.2.0.2 Part Number A96160-01 |
|
Oracle.DataAccess.Types Namespace (ODP.NET Types), 2 of 17
The OracleBinary structure represents a variable-length stream of binary data to be stored in or retrieved from a database.
Object
ValueType
OracleBinary
// C# public struct OracleBinary : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Concatenation of the OracleBinary values using + operator OracleBinary ob1a = new OracleBinary(new byte[] {1,2,3}); OracleBinary ob1b = new OracleBinary(new byte[] {4}); OracleBinary ob1 = ob1a + ob1b; OracleBinary ob2 = new OracleBinary(new byte[] {1,2,3,4}); // Output the length if ob1 is equal to ob2 if (ob1 == ob2) Console.WriteLine("The OracleBinary structures are equal with length " + ob1.Length);
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccesss.dll
OracleBinary members are listed in the following tables:
OracleBinary constructors are listed in Table 5-1
| Constructor | Description |
|---|---|
|
Instantiates a new instance of OracleBinary class (Overloaded) |
The OracleBinary static fields are listed in Table 5-2.
| Field | Description |
|---|---|
|
Represents a null value that can be assigned to an instance of the |
The OracleBinary static methods are listed in Table 5-3.
The OracleBinary static operators are listed in Table 5-4.
The OracleBinary static type conversion operators are listed in Table 5-5.
| Operator | Description |
|---|---|
|
Converts an instance value to a byte array |
|
|
Converts an instance value to an |
The OracleBinary properties are listed in Table 5-6.
The OracleBinary instance methods are listed in Table 5-7.
The OracleBinary constructor instantiates a new instance of the OracleBinary structure and sets its value to the provided array of bytes.
// C#public OracleBinary(byte[ ]bytes);
The OracleBinary static fields are listed in Table 5-8.
| Field | Description |
|---|---|
|
Represents a null value that can be assigned to an instance of the |
This static field represents a null value that can be assigned to an instance of the OracleBinary structure.
// C# public static readonly OracleBinary Null;
The OracleBinary static methods are listed in Table 5-9.
This method returns the concatenation of two OracleBinary structures.
// C# public static OracleBinary Concat(OracleBinary value1, OracleBinary value2);
An OracleBinary.
If either argument has a null value, the returned OracleBinary structure has a null value.
This method determines if two OracleBinary values are equal.
// C# public static bool Equals(OracleBinary value1, OracleBinary value2);
Returns true if two OracleBinary values are equal; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines whether the first of two OracleBinary values is greater than the second.
// C# public static bool GreaterThan(OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is greater than the second; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
// C# OracleBinary ob1 = OracleBinary.Null; OracleBinary ob2 = new OracleBinary(new byte[] {1}); if (OracleBinary.GreaterThan(ob2,ob1)) Console.WriteLine("ob2 > ob1");
This method determines whether the first of two OracleBinary values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is greater than or equal to the second; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines whether the first of two OracleBinary values is less than the second.
// C# public static bool LessThan(OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is less than the second; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines whether the first of two OracleBinary values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is less than or equal to the second; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines whether two OracleBinary values are not equal.
// C# public static bool NotEquals(OracleBinary value1, OracleBinary value2);
Returns true if two OracleBinary values are not equal; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
The OracleBinary static operators are listed in Table 5-10.
This method concatenates two OracleBinary values.
// C# public static OracleBinary operator + (OracleBinary value1, OracleBinary value2);
OracleBinary
If either argument has a null value, the returned OacleBinary structure has a null value.
This method determines if two OracleBinary values are equal.
// C# public static bool operator == (OracleBinary value1, OracleBinary value2);
Returns true if they are the same; otherwise returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines if the first of two OracleBinary values is greater than the second.
// C# public static bool operator > (OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is greater than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
// C# OracleBinary ob1 = OracleBinary.Null; OracleBinary ob2 = new OracleBinary(new byte[] {1}); if (ob2 > ob1) Console.WriteLine("ob2 > ob1");
This method determines if the first of two OracleBinary values is greater than or equal to the second.
// C# public static bool operator >= (OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is greater than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines if two OracleBinary values are not equal.
// C# public static bool operator != (OracleBinary value1, OracleBinary value2);
Returns true if the two OracleBinary values are not equal; otherwise, returns false.
This method determines if the first of two OracleBinary values is less than the second.
// C# public static bool operator < ( OracleBinary value1, OracleBinary value2);
Returns true if the first of two OracleBinary values is less than the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
This method determines if the first of two OracleBinary values is less than or equal to the second.
// C# public static bool operator <= (OracleBinary value1, OracleBinary value1);
Returns true if the first of two OracleBinary values is less than or equal to the second; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
The OracleBinary static type conversion operators are listed in Table 5-11.
| Operator | Description |
|---|---|
|
Converts an instance value to a byte array |
|
|
Converts an instance value to an |
This method converts an OracleBinary value to a byte array.
// C# public static explicit operator byte[ ] (OracleBinary val);
A byte array.
OracleNullValueException - The OracleBinary structure has a null value.
This method converts a byte array to an OracleBinary structure.
// C# public static implicit operator OracleBinary(byte[ ] bytes);
OracleBinary
The OracleBinary properties are listed in Table 5-12.
This property indicates whether the current instance has a null value.
// C# public bool IsNull {get;}
Returns true if the current instance has a null value; otherwise returns false.
This property obtains the particular byte in an OracleBinary structure using an index.
// C# public byte this[int index] {get;}
A byte in the specified index.
OracleNullValueException - The current instance has a null value.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {4,3,2,1}); Console.WriteLine(ob1[ob1.Length-1]); // Prints the value 1
This property returns the length of the binary data.
// C# public int length {get;}
Length of the binary data.
OracleNullValueException - The current instance has a null value.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {4,3,2,1}); Console.WriteLine(ob1.Length); // Prints the value 4
This property returns the binary data that is stored in the OracleBinary structure.
// C# public byte[] Value {get;}
Binary data.
OracleNullValueException - The current instance has a null value.
The OracleBinary instance methods are listed in Table 5-13.
This method compares the current instance to an object and returns an integer that represents their relative values
// C# public int CompareTo(object obj);
The method returns a number that is:
OracleBinary instance value is less than obj.
OracleBinary instance and obj values have the same binary data.
OracleBinary instance value is greater than obj.
IComparable
ArgumentException - The parameter is not of type OracleBinary.
The following rules apply to the behavior of this method.
OracleBinarys. For example, comparing an OracleBinary instance with an OracleTimeStamp instance is not allowed. When an OracleBinary is compared with a different type, an ArgumentException is thrown.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {1,1,1,1}); OracleBinary ob2 = new OracleBinary(new byte[] {1}); // append to ob2 while they are not equal while (ob1.CompareTo(ob2) != 0) ob2 = ob2 + ob2; Console.WriteLine("ob1 == ob2");
This method determines whether an object is an instance of OracleBinary, and has the same binary data as the current instance.
// C# public override bool Equals(object obj);
Returns true if obj is an instance of OracleBinary, and has the same binary data as the current instance; otherwise, returns false.
The following rules apply to the behavior of this method.
OracleBinary that has a value is greater than an OracleBinary that has a null value.
OracleBinarys that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleBinary instance.
// C# public override int GetHashCode();
An int that represents the hash
Overrides Object
This method converts an OracleBinary instance to a string instance.
// C# public override string ToString();
string
If the current OracleBinary instance has a null value, the returned string "null".
|
|
![]() Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|