// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 
// Source File Name:   OPAQUE.java
// Class Version:      45.3

package oracle.sql;

import java.sql.Connection;
import java.sql.SQLException;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.dbaccess.DBError;

// Referenced classes of package oracle.sql:
//            Datum, OpaqueDescriptor, TypeDescriptor

// flag ACC_SUPER is set
public class OPAQUE extends Datum
{
    // Constants:          114
    // Interfaces:         0
    // Fields:             5
    // Methods:            18
    // Class Attributes:   1


    OpaqueDescriptor m_descriptor;
    OracleConnection m_conn;
    byte m_value[];
    long m_imgOffset;
    long m_imgLength;

    // Decompiling method: <init>  Signature: (Loracle/sql/OpaqueDescriptor;Ljava/sql/Connection;Ljava/lang/Object;)V
    // Max stack: 2, #locals: 4, #params: 4
    // Code length: 71 bytes, Code offset: 1587
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 71 Range 0 70 Init 0 fixed
    // Parameter  1 added: Name opaquedescriptor Type Loracle/sql/OpaqueDescriptor; At 0 71 Range 0 70 Init 0
    // Parameter  2 added: Name connection Type Ljava/sql/Connection; At 0 71 Range 0 70 Init 0
    // Parameter  3 added: Name obj Type Ljava/lang/Object; At 0 71 Range 0 70 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 71 Range 0 70 Init 0 fixed
    public OPAQUE(OpaqueDescriptor opaquedescriptor, Connection connection, Object obj)
        throws SQLException
    {
        super();
        if(opaquedescriptor != null)
        {
            m_descriptor = opaquedescriptor;
        } else
        {
            DBError.check_error(61, "OPAQUE");
        }
        if(connection != null)
        {
            m_conn = (OracleConnection)connection;
        } else
        {
            DBError.check_error(8, "Connection is null");
        }
        if(obj instanceof byte[])
        {
            m_value = (byte[])obj;
        } else
        {
            DBError.throwSqlException(59, "OPAQUE()");
        }
        return;
    }

    // Decompiling method: <init>  Signature: (Loracle/sql/OpaqueDescriptor;[BLjava/sql/Connection;)V
    // Max stack: 2, #locals: 4, #params: 4
    // Code length: 38 bytes, Code offset: 1758
    // Line Number Table found: 8 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 38 Range 0 37 Init 0 fixed
    // Parameter  1 added: Name opaquedescriptor Type Loracle/sql/OpaqueDescriptor; At 0 38 Range 0 37 Init 0
    // Parameter  2 added: Name abyte0 Type [B At 0 38 Range 0 37 Init 0
    // Parameter  3 added: Name connection Type Ljava/sql/Connection; At 0 38 Range 0 37 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 38 Range 0 37 Init 0 fixed
    public OPAQUE(OpaqueDescriptor opaquedescriptor, byte abyte0[], Connection connection)
        throws SQLException
    {
        super(abyte0);
        if(connection != null)
        {
            m_conn = (OracleConnection)connection;
        } else
        {
            DBError.check_error(8, "Connection is null");
        }
        m_descriptor = opaquedescriptor;
        m_value = null;
        return;
    }

    // Decompiling method: getBytesValue  Signature: ()[B
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 10 bytes, Code offset: 1872
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 10 Range 0 9 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [B At 0 10 Range 0 9 Init 0 fixed
    public byte[] getBytesValue()
        throws SQLException
    {
        return m_descriptor.toValue(this, false);
    }

    // Decompiling method: getConnection  Signature: ()Loracle/jdbc/driver/OracleConnection;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 16 bytes, Code offset: 1930
    // Exception table: 1 entries
    //           start  0 end 8 handler 8 type ClassCastException
    // Line Number Table found: 5 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 16 Range 0 15 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Loracle/jdbc/driver/OracleConnection; At 0 16 Range 0 15 Init 0 fixed
    public oracle.jdbc.driver.OracleConnection getConnection()
        throws SQLException
    {
        try
        {
            return (oracle.jdbc.driver.OracleConnection)getJavaSqlConnection();
        }
        catch(ClassCastException _ex)
        {
            DBError.throwSqlException(103);
        }
        return null;
    }

    // Decompiling method: getDescriptor  Signature: ()Loracle/sql/OpaqueDescriptor;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2024
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Loracle/sql/OpaqueDescriptor; At 0 5 Range 0 4 Init 0 fixed
    public OpaqueDescriptor getDescriptor()
        throws SQLException
    {
        return m_descriptor;
    }

    // Decompiling method: getImageLength  Signature: ()J
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2077
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type J At 0 5 Range 0 4 Init 0 fixed
    public long getImageLength()
    {
        return m_imgLength;
    }

    // Decompiling method: getImageOffset  Signature: ()J
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2120
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type J At 0 5 Range 0 4 Init 0 fixed
    public long getImageOffset()
    {
        return m_imgOffset;
    }

    // Decompiling method: getJavaSqlConnection  Signature: ()Ljava/sql/Connection;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 2163
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/sql/Connection; At 0 5 Range 0 4 Init 0 fixed
    public Connection getJavaSqlConnection()
        throws SQLException
    {
        return m_conn;
    }

    // Decompiling method: getSQLTypeName  Signature: ()Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 2216
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/String; At 0 8 Range 0 7 Init 0 fixed
    public String getSQLTypeName()
        throws SQLException
    {
        return m_descriptor.getName();
    }

    // Decompiling method: getValue  Signature: ()Ljava/lang/Object;
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 10 bytes, Code offset: 2272
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 10 Range 0 9 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/Object; At 0 10 Range 0 9 Init 0 fixed
    public Object getValue()
        throws SQLException
    {
        return m_descriptor.toValue(this, false);
    }

    // Decompiling method: isConvertibleTo  Signature: (Ljava/lang/Class;)Z
    // Max stack: 1, #locals: 2, #params: 2
    // Code length: 2 bytes, Code offset: 2330
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 2 Range 0 1 Init 0 fixed
    // Parameter  1 added: Name class1 Type Ljava/lang/Class; At 0 2 Range 0 1 Init 0
    // RetValue   2 added: Name <returnValue> Type Z At 0 2 Range 0 1 Init 0 fixed
    public boolean isConvertibleTo(Class class1)
    {
        return false;
    }

    // Decompiling method: makeJdbcArray  Signature: (I)Ljava/lang/Object;
    // Max stack: 1, #locals: 2, #params: 2
    // Code length: 5 bytes, Code offset: 2370
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 5 Range 0 4 Init 0 fixed
    // Parameter  1 added: Name i Type I At 0 5 Range 0 4 Init 0
    // RetValue   2 added: Name <returnValue> Type Ljava/lang/Object; At 0 5 Range 0 4 Init 0 fixed
    public Object makeJdbcArray(int i)
    {
        return ((Object) (new Object[i]));
    }

    // Decompiling method: setDescriptor  Signature: (Loracle/sql/OpaqueDescriptor;)V
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 6 bytes, Code offset: 2413
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 6 Range 0 5 Init 0 fixed
    // Parameter  1 added: Name opaquedescriptor Type Loracle/sql/OpaqueDescriptor; At 0 6 Range 0 5 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 6 Range 0 5 Init 0 fixed
    public void setDescriptor(OpaqueDescriptor opaquedescriptor)
    {
        m_descriptor = opaquedescriptor;
        return;
    }

    // Decompiling method: setImage  Signature: ([BJJ)V
    // Max stack: 3, #locals: 6, #params: 6
    // Code length: 17 bytes, Code offset: 2461
    // Line Number Table found: 4 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 17 Range 0 16 Init 0 fixed
    // Parameter  1 added: Name abyte0 Type [B At 0 17 Range 0 16 Init 0
    // Parameter  2 added: Name l Type J At 0 17 Range 0 16 Init 0
    // Parameter  4 added: Name l1 Type J At 0 17 Range 0 16 Init 0
    // RetValue   6 added: Name <returnValue> Type V At 0 17 Range 0 16 Init 0 fixed
    public void setImage(byte abyte0[], long l, long l1)
        throws SQLException
    {
        setShareBytes(abyte0);
        m_imgOffset = l;
        m_imgLength = l1;
        return;
    }

    // Decompiling method: setImageLength  Signature: (J)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 6 bytes, Code offset: 2538
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 6 Range 0 5 Init 0 fixed
    // Parameter  1 added: Name l Type J At 0 6 Range 0 5 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 6 Range 0 5 Init 0 fixed
    public void setImageLength(long l)
        throws SQLException
    {
        m_imgLength = l;
        return;
    }

    // Decompiling method: setValue  Signature: ([B)V
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 6 bytes, Code offset: 2596
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 6 Range 0 5 Init 0 fixed
    // Parameter  1 added: Name abyte0 Type [B At 0 6 Range 0 5 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 6 Range 0 5 Init 0 fixed
    public void setValue(byte abyte0[])
        throws SQLException
    {
        m_value = abyte0;
        return;
    }

    // Decompiling method: toBytes  Signature: ()[B
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 10 bytes, Code offset: 2654
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 10 Range 0 9 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [B At 0 10 Range 0 9 Init 0 fixed
    public byte[] toBytes()
        throws SQLException
    {
        return m_descriptor.toBytes(this, false);
    }

    // Decompiling method: toJdbc  Signature: ()Ljava/lang/Object;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 2 bytes, Code offset: 2712
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/OPAQUE; At 0 2 Range 0 1 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/Object; At 0 2 Range 0 1 Init 0 fixed
    public Object toJdbc()
        throws SQLException
    {
        return this;
    }
}
