OracleBinary Structure
The OracleBinary structure represents a variable-length stream of binary data to be stored in or retrieved from a database.
Class Inheritance
System.Object
System.ValueType
Oracle.DataAccess.Types.OracleBinary
Declaration
// C#
public struct OracleBinary : IComparable, INullable, IXmlSerializable
Requirements
| Provider | ODP.NET, Unmanaged Driver | ODP.NET, Managed Driver | ODP.NET Core |
|---|---|---|---|
| Assembly | Oracle.DataAccess.dll |
Oracle.ManagedDataAccess.dll |
Oracle.ManagedDataAccess.dll |
| Namespace | Oracle.DataAccess.Client |
Oracle.ManagedDataAccess.Client |
Oracle.ManagedDataAccess.Client |
| .NET Framework | See System Requirements | See System Requirements | - |
| .NET (Core) | - | - | See System Requirements |
Thread Safety
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
Example
// C#
using System;
using Oracle.DataAccess.Types;
class OracleBinarySample
{
static void Main(string[] args)
{
// Initialize the OracleBinary structures
OracleBinary binary1= new OracleBinary(new byte[] {1,2,3,4,5});
OracleBinary binary2 = new OracleBinary(new byte[] {1,2,3});
OracleBinary binary3 = new OracleBinary(new byte[] {4,5});
OracleBinary binary4 = binary2 + binary3;
// Compare binary1 and binary4; they're equal
if (binary1 == binary4)
Console.WriteLine("The two OracleBinary structs are equal");
else
Console.WriteLine("The two OracleBinary structs are different");
}
}