// 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:   LobPlsqlUtil.java
// Class Version:      45.3

package oracle.sql;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.sql.*;
import oracle.jdbc.Const;
import oracle.jdbc.OracleTypes;
import oracle.jdbc.dbaccess.*;
import oracle.jdbc.driver.*;

// Referenced classes of package oracle.sql:
//            BFILE, BLOB, CLOB, Datum

// flag ACC_SUPER is set
public class LobPlsqlUtil
{
    // Constants:          435
    // Interfaces:         0
    // Fields:             4
    // Methods:            39
    // Class Attributes:   1


    static boolean PLSQL_DEBUG = false;
    static final int MAX_PLSQL_SIZE = 32512;
    static final int MAX_PLSQL_INSTR_SIZE = 32512;
    static final int MAX_CHUNK_SIZE = 32512;

    // Decompiling method: <init>  Signature: ()V
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 6033
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/LobPlsqlUtil; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 5 Range 0 4 Init 0 fixed
    public LobPlsqlUtil()
    {
        super();
        return;
    }

    // Decompiling method: getPlsqlMaxInstrSize  Signature: (Loracle/jdbc/driver/OracleConnection;)I
    // Max stack: 3, #locals: 4, #params: 1
    // Code length: 40 bytes, Code offset: 6076
    // Line Number Table found: 9 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 40 Range 0 39 Init 0
    // RetValue   4 added: Name <returnValue> Type I At 0 40 Range 0 39 Init 0 fixed
    // LocalVar   1 added: Name dbconversion Type Loracle/jdbc/dbaccess/DBConversion; At 4 10 Range 4 13 Init 4
    // LocalVar   2 added: Name flag Type Z At 12 7 Range 12 18 Init 12
    // LocalVar   3 added: Name i Type I At 17 16 Range 17 32 Init 17
    private static int getPlsqlMaxInstrSize(OracleConnection oracleconnection)
        throws SQLException
    {
        DBConversion dbconversion = oracleconnection.conversion;
        boolean flag = DBConversion.isCharSetMultibyte(dbconversion.getAccessCharSet());
        int i = dbconversion.getMaxCharbyteSize();
        if(flag)
        {
            return 32512 / (oracleconnection.db_access.getC2SNlsRatio() * i);
        } else
        {
            return 32512;
        }
    }

    // Decompiling method: isNCLOB  Signature: (Loracle/sql/Datum;)Z
    // Max stack: 2, #locals: 3, #params: 1
    // Code length: 34 bytes, Code offset: 6196
    // Exception table: 1 entries
    //           start  2 end 8 handler 11 type ClassNotFoundException
    // Line Number Table found: 8 entries
    // Parameter  0 added: Name datum Type Loracle/sql/Datum; At 0 34 Range 0 33 Init 0
    // RetValue   3 added: Name <returnValue> Type Z At 0 34 Range 0 33 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 1 Range 1 1 Init 1
    // LocalVar   1 added: Name class1 Type Ljava/lang/Class; At 7 8 Range 7 14 Init 7
    // LocalVar   2 added: Name clob Type Loracle/sql/CLOB; At 28 2 Range 28 29 Init 28
    // LocalVar   1 chged: Name class2 Oname obj Type Ljava/lang/Class; At 1 1 Range 1 1 Init 1
    // LocalVar   1 name class1(Ljava/lang/Class;) merged out into class2(Ljava/lang/Class;)
    private static boolean isNCLOB(Datum datum)
    {
        Class class1 = null;
        try
        {
            class1 = Class.forName("oracle.sql.CLOB");
        }
        catch(ClassNotFoundException _ex)
        {
            return false;
        }
        if(!class1.isInstance(datum))
        {
            return false;
        } else
        {
            CLOB clob = (CLOB)datum;
            return clob.isNCLOB();
        }
    }

    // Decompiling method: plsql_closeLob  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;I)V
    // Max stack: 3, #locals: 6, #params: 3
    // Code length: 81 bytes, Code offset: 6304
    // Exception table: 1 entries
    //           start  2 end 56 handler 62 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 81 Range 0 80 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 81 Range 0 80 Init 0
    // Parameter  2 added: Name i Type I At 0 81 Range 0 80 Init 0
    // RetValue   6 added: Name <returnValue> Type V At 0 81 Range 0 80 Init 0 fixed
    // LocalVar   3 added: Name obj Type A At 1 72 Range 1 72 Init 1
    // LocalVar   3 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 13 60 Range 1 72 Init 1
    // LocalVar   5 added: Name local Type @ At 70 10 Range 70 79 Init 70
    // LocalVar   3 added: Name obj Type A At 77 1 Range 77 77 Init 77
    // LocalVar   4 added: Name exception Type Ljava.lang.Exception; At 62 7 Range 62 68 Init 62
    // LocalVar   3 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_closeLob(Connection connection, Datum datum, int i)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin dbms_lob.close (?); end;");
            oraclecallablestatement.registerOutParameter(1, i);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
            }
            oraclecallablestatement.setOracleObject(1, datum);
            oraclecallablestatement.execute();
            datum.setShareBytes(oraclecallablestatement.getOracleObject(1).shareBytes());
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return;
    }

    // Decompiling method: plsql_createTemporaryLob  Signature: (Ljava/sql/Connection;ZII)Loracle/sql/Datum;
    // Max stack: 4, #locals: 8, #params: 4
    // Code length: 99 bytes, Code offset: 6497
    // Exception table: 1 entries
    //           start  3 end 79 handler 79 type any
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 99 Range 0 98 Init 0
    // Parameter  1 added: Name flag Type Z At 0 99 Range 0 98 Init 0
    // Parameter  2 added: Name i Type I At 0 99 Range 0 98 Init 0
    // Parameter  3 added: Name j Type I At 0 99 Range 0 98 Init 0
    // RetValue   8 added: Name <returnValue> Type Loracle/sql/Datum; At 0 99 Range 0 98 Init 0 fixed
    // LocalVar   4 added: Name obj Type A At 1 90 Range 1 90 Init 1
    // LocalVar   4 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 43 48 Range 1 90 Init 1
    // LocalVar   5 added: Name datum Type Loracle/sql/Datum; At 71 7 Range 71 77 Init 71
    // LocalVar   7 added: Name local Type @ At 87 12 Range 87 98 Init 87
    // LocalVar   4 added: Name obj Type A At 95 2 Range 95 96 Init 95
    // LocalVar   6 added: Name exception Type Ljava.lang.Exception; At 79 7 Range 79 85 Init 79
    // LocalVar   4 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static Datum plsql_createTemporaryLob(Connection connection, boolean flag, int i, int j)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin dbms_lob.createTemporary (?," + (flag ? "TRUE" : "FALSE") + ", ?); end;");
            oraclecallablestatement.registerOutParameter(1, j);
            oraclecallablestatement.setInt(2, i);
            oraclecallablestatement.execute();
            Datum datum = oraclecallablestatement.getOracleObject(1);
            return datum;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_fileClose  Signature: (Loracle/sql/BFILE;)V
    // Max stack: 3, #locals: 4, #params: 1
    // Code length: 67 bytes, Code offset: 6704
    // Exception table: 1 entries
    //           start  2 end 45 handler 51 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 67 Range 0 66 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 67 Range 0 66 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 58 Range 1 58 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 45 Range 1 58 Init 1
    // LocalVar   3 added: Name local Type @ At 57 9 Range 57 65 Init 57
    // LocalVar   1 added: Name obj Type A At 63 1 Range 63 63 Init 63
    // LocalVar   2 added: Name exception Type Ljava.lang.Exception; At 51 5 Range 51 55 Init 51
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_fileClose(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin dbms_lob.fileclose (?); end;");
            oraclecallablestatement.setBFILE(1, bfile);
            oraclecallablestatement.registerOutParameter(1, -13);
            oraclecallablestatement.execute();
            bfile.setLocator(oraclecallablestatement.getBFILE(1).getLocator());
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return;
    }

    // Decompiling method: plsql_fileExists  Signature: (Loracle/sql/BFILE;)Z
    // Max stack: 3, #locals: 5, #params: 1
    // Code length: 59 bytes, Code offset: 6883
    // Exception table: 1 entries
    //           start  2 end 43 handler 43 type any
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 59 Range 0 58 Init 0
    // RetValue   5 added: Name <returnValue> Type Z At 0 59 Range 0 58 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 51 Range 1 51 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 38 Range 1 51 Init 1
    // LocalVar   2 added: Name flag Type Z At 37 5 Range 37 41 Init 37
    // LocalVar   4 added: Name local Type @ At 49 10 Range 49 58 Init 49
    // LocalVar   1 added: Name obj Type A At 56 1 Range 56 56 Init 56
    // LocalVar   3 added: Name exception Type Ljava.lang.Exception; At 43 5 Range 43 47 Init 43
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static boolean plsql_fileExists(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin ? := dbms_lob.fileExists(?); end; ");
            oraclecallablestatement.registerOutParameter(1, 2);
            oraclecallablestatement.setBFILE(2, bfile);
            oraclecallablestatement.execute();
            boolean flag = oraclecallablestatement.getBoolean(1);
            return flag;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_fileGetDirAlias  Signature: (Loracle/sql/BFILE;)Ljava/lang/String;
    // Max stack: 3, #locals: 5, #params: 1
    // Code length: 67 bytes, Code offset: 7050
    // Exception table: 1 entries
    //           start  2 end 51 handler 51 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 67 Range 0 66 Init 0
    // RetValue   5 added: Name <returnValue> Type Ljava/lang/String; At 0 67 Range 0 66 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 59 Range 1 59 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 46 Range 1 59 Init 1
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 45 5 Range 45 49 Init 45
    // LocalVar   4 added: Name local Type @ At 57 10 Range 57 66 Init 57
    // LocalVar   1 added: Name obj Type A At 64 1 Range 64 64 Init 64
    // LocalVar   3 added: Name exception Type Ljava.lang.Exception; At 51 5 Range 51 55 Init 51
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static String plsql_fileGetDirAlias(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin dbms_lob.fileGetName(?, ?, ?); end; ");
            oraclecallablestatement.setBFILE(1, bfile);
            oraclecallablestatement.registerOutParameter(2, 12);
            oraclecallablestatement.registerOutParameter(3, 12);
            oraclecallablestatement.execute();
            String s = oraclecallablestatement.getString(2);
            return s;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_fileGetName  Signature: (Loracle/sql/BFILE;)Ljava/lang/String;
    // Max stack: 3, #locals: 5, #params: 1
    // Code length: 67 bytes, Code offset: 7229
    // Exception table: 1 entries
    //           start  2 end 51 handler 51 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 67 Range 0 66 Init 0
    // RetValue   5 added: Name <returnValue> Type Ljava/lang/String; At 0 67 Range 0 66 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 59 Range 1 59 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 46 Range 1 59 Init 1
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 45 5 Range 45 49 Init 45
    // LocalVar   4 added: Name local Type @ At 57 10 Range 57 66 Init 57
    // LocalVar   1 added: Name obj Type A At 64 1 Range 64 64 Init 64
    // LocalVar   3 added: Name exception Type Ljava.lang.Exception; At 51 5 Range 51 55 Init 51
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static String plsql_fileGetName(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin dbms_lob.fileGetName(?, ?, ?); end; ");
            oraclecallablestatement.setBFILE(1, bfile);
            oraclecallablestatement.registerOutParameter(2, 12);
            oraclecallablestatement.registerOutParameter(3, 12);
            oraclecallablestatement.execute();
            String s = oraclecallablestatement.getString(3);
            return s;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_fileIsOpen  Signature: (Loracle/sql/BFILE;)Z
    // Max stack: 3, #locals: 5, #params: 1
    // Code length: 59 bytes, Code offset: 7408
    // Exception table: 1 entries
    //           start  2 end 43 handler 43 type any
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 59 Range 0 58 Init 0
    // RetValue   5 added: Name <returnValue> Type Z At 0 59 Range 0 58 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 51 Range 1 51 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 38 Range 1 51 Init 1
    // LocalVar   2 added: Name flag Type Z At 37 5 Range 37 41 Init 37
    // LocalVar   4 added: Name local Type @ At 49 10 Range 49 58 Init 49
    // LocalVar   1 added: Name obj Type A At 56 1 Range 56 56 Init 56
    // LocalVar   3 added: Name exception Type Ljava.lang.Exception; At 43 5 Range 43 47 Init 43
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static boolean plsql_fileIsOpen(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin ? := dbms_lob.fileIsOpen(?); end; ");
            oraclecallablestatement.registerOutParameter(1, 2);
            oraclecallablestatement.setBFILE(2, bfile);
            oraclecallablestatement.execute();
            boolean flag = oraclecallablestatement.getBoolean(1);
            return flag;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_fileOpen  Signature: (Loracle/sql/BFILE;)V
    // Max stack: 3, #locals: 4, #params: 1
    // Code length: 73 bytes, Code offset: 7575
    // Exception table: 1 entries
    //           start  2 end 51 handler 57 type any
    // Line Number Table found: 16 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 73 Range 0 72 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 73 Range 0 72 Init 0 fixed
    // LocalVar   1 added: Name obj Type A At 1 64 Range 1 64 Init 1
    // LocalVar   1 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 51 Range 1 64 Init 1
    // LocalVar   3 added: Name local Type @ At 63 9 Range 63 71 Init 63
    // LocalVar   1 added: Name obj Type A At 69 1 Range 69 69 Init 69
    // LocalVar   2 added: Name exception Type Ljava.lang.Exception; At 57 5 Range 57 61 Init 57
    // LocalVar   1 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_fileOpen(BFILE bfile)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)bfile.getConnection().prepareCall("begin dbms_lob.fileopen (?, ?); end;");
            oraclecallablestatement.setBFILE(1, bfile);
            oraclecallablestatement.setInt(2, 0);
            oraclecallablestatement.registerOutParameter(1, -13);
            oraclecallablestatement.execute();
            bfile.setLocator(oraclecallablestatement.getBFILE(1).getLocator());
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return;
    }

    // Decompiling method: plsql_freeTemporaryLob  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;I)V
    // Max stack: 3, #locals: 6, #params: 3
    // Code length: 78 bytes, Code offset: 7764
    // Exception table: 1 entries
    //           start  2 end 53 handler 59 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 78 Range 0 77 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 78 Range 0 77 Init 0
    // Parameter  2 added: Name i Type I At 0 78 Range 0 77 Init 0
    // RetValue   6 added: Name <returnValue> Type V At 0 78 Range 0 77 Init 0 fixed
    // LocalVar   3 added: Name obj Type A At 1 69 Range 1 69 Init 1
    // LocalVar   3 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 13 57 Range 1 69 Init 1
    // LocalVar   5 added: Name local Type @ At 67 10 Range 67 76 Init 67
    // LocalVar   3 added: Name obj Type A At 74 1 Range 74 74 Init 74
    // LocalVar   4 added: Name exception Type Ljava.lang.Exception; At 59 7 Range 59 65 Init 59
    // LocalVar   3 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_freeTemporaryLob(Connection connection, Datum datum, int i)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin dbms_lob.freeTemporary (?); end;");
            oraclecallablestatement.registerOutParameter(1, i);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
            }
            oraclecallablestatement.setOracleObject(1, datum);
            oraclecallablestatement.execute();
            datum.setShareBytes(oraclecallablestatement.getBytes(1));
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return;
    }

    // Decompiling method: plsql_getChunkSize  Signature: (Loracle/jdbc/driver/OracleConnection;Loracle/sql/Datum;I)J
    // Max stack: 4, #locals: 9, #params: 3
    // Code length: 112 bytes, Code offset: 7954
    // Exception table: 2 entries
    //           start  5 end 58 handler 61 type SQLException
    //           start  5 end 84 handler 90 type any
    // Line Number Table found: 21 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 112 Range 0 111 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 112 Range 0 111 Init 0
    // Parameter  2 added: Name i Type I At 0 112 Range 0 111 Init 0
    // RetValue   9 added: Name <returnValue> Type J At 0 112 Range 0 111 Init 0 fixed
    // LocalVar   3 added: Name l Type J At 1 1 Range 1 1 Init 1
    // LocalVar   5 added: Name obj Type A At 3 99 Range 3 101 Init 3
    // LocalVar   5 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 88 Range 3 101 Init 3
    // LocalVar   3 added: Name l1 Type J At 57 54 Range 57 110 Init 57
    // LocalVar   7 added: Name local Type @ At 98 12 Range 98 109 Init 98
    // LocalVar   5 added: Name obj Type A At 106 2 Range 106 107 Init 106
    // LocalVar   8 added: Name sqlexception Type Ljava/sql/SQLException; At 61 15 Range 61 75 Init 61
    // LocalVar   6 added: Name exception Type Ljava.lang.Exception; At 90 7 Range 90 96 Init 90
    // LocalVar   3 name l1(J) merged out into l(J)
    // LocalVar   5 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static long plsql_getChunkSize(OracleConnection oracleconnection, Datum datum, int i)
        throws SQLException
    {
        long l = 0L;
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin ? := dbms_lob.getchunksize(?); end;");
            oraclecallablestatement.registerOutParameter(1, 2);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(2, (short)2);
            }
            oraclecallablestatement.setObject(2, datum, i);
            oraclecallablestatement.execute();
            l = oraclecallablestatement.getLong(1);
        }
        catch(SQLException sqlexception)
        {
            if(sqlexception.getErrorCode() != 6550)
            {
                throw sqlexception;
            }
            l = 32512L;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return l;
    }

    // Decompiling method: plsql_getChunkSize  Signature: (Loracle/sql/BLOB;)J
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 12 bytes, Code offset: 8210
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 12 Range 0 11 Init 0
    // RetValue   1 added: Name <returnValue> Type J At 0 12 Range 0 11 Init 0 fixed
    public static long plsql_getChunkSize(BLOB blob)
        throws SQLException
    {
        return plsql_getChunkSize(blob.getConnection(), ((Datum) (blob)), 2004);
    }

    // Decompiling method: plsql_getChunkSize  Signature: (Loracle/sql/CLOB;)J
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 12 bytes, Code offset: 8270
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 12 Range 0 11 Init 0
    // RetValue   1 added: Name <returnValue> Type J At 0 12 Range 0 11 Init 0 fixed
    public static long plsql_getChunkSize(CLOB clob)
        throws SQLException
    {
        return plsql_getChunkSize(clob.getConnection(), ((Datum) (clob)), 2005);
    }

    // Decompiling method: plsql_hasPattern  Signature: (Loracle/jdbc/driver/OracleConnection;Loracle/sql/Datum;I[BJ)J
    // Max stack: 6, #locals: 21, #params: 6
    // Code length: 379 bytes, Code offset: 8330
    // Exception table: 1 entries
    //           start  68 end 129 handler 129 type any
    // Line Number Table found: 66 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 379 Range 0 378 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 379 Range 0 378 Init 0
    // Parameter  2 added: Name i Type I At 0 379 Range 0 378 Init 0
    // Parameter  3 added: Name abyte0 Type [B At 0 379 Range 0 378 Init 0
    // Parameter  4 added: Name l Type J At 0 379 Range 0 378 Init 0
    // RetValue  21 added: Name <returnValue> Type J At 0 379 Range 0 378 Init 0 fixed
    // LocalVar   6 added: Name l1 Type J At 16 317 Range 16 332 Init 16
    // LocalVar   8 added: Name l2 Type J At 24 145 Range 24 168 Init 24
    // LocalVar  10 added: Name obj Type A At 66 75 Range 66 140 Init 66
    // LocalVar  10 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 77 64 Range 66 140 Init 66
    // LocalVar  11 added: Name l3 Type J At 121 7 Range 121 127 Init 121
    // LocalVar  14 added: Name local Type @ At 137 12 Range 137 148 Init 137
    // LocalVar  10 added: Name obj Type A At 145 2 Range 145 146 Init 145
    // LocalVar  10 added: Name flag Type Z At 150 2 Range 150 151 Init 150
    // LocalVar  11 added: Name l4 Type J At 154 68 Range 154 221 Init 154
    // LocalVar  13 added: Name flag1 Type Z At 157 216 Range 157 372 Init 157
    // LocalVar  17 added: Name l5 Type J At 160 218 Range 160 377 Init 160
    // LocalVar  10 added: Name flag2 Type Z At 181 61 Range 181 241 Init 181
    // LocalVar  10 chged: Name j Oname flag2 Type I At 188 2 Range 181 241 Init 181
    // LocalVar  19 added: Name k Type I At 196 55 Range 196 250 Init 196
    // LocalVar  16 added: Name abyte1 Type [B At 202 18 Range 202 219 Init 202
    // LocalVar  14 added: Name l6 Type J At 225 24 Range 225 248 Init 225
    // LocalVar  10 added: Name i1 Type I At 245 114 Range 245 358 Init 245
    // LocalVar  20 added: Name flag2 Type Z At 256 112 Range 256 367 Init 256
    // LocalVar  19 added: Name j1 Type I At 274 50 Range 274 323 Init 274
    // LocalVar  16 added: Name abyte2 Type [B At 280 18 Range 280 297 Init 280
    // LocalVar  14 added: Name l7 Type J At 303 54 Range 303 356 Init 303
    // LocalVar  13 added: Name exception Type Ljava.lang.Exception; At 129 7 Range 129 135 Init 129
    // LocalVar  10 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    // LocalVar  10 name i1(I) merged out into j(I)
    public static long plsql_hasPattern(OracleConnection oracleconnection, Datum datum, int i, byte abyte0[], long l)
        throws SQLException
    {
        if(abyte0 == null || l <= 0L)
        {
            return 0L;
        }
        long l1 = abyte0.length;
        long l2 = plsql_length(oracleconnection, datum, i);
        if(l1 == 0L || l1 > (l2 - l) + 1L || l > l2)
        {
            return 0L;
        }
        if(l1 <= 32512L)
        {
            OracleCallableStatement oraclecallablestatement = null;
            try
            {
                oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin ? := dbms_lob.instr(?, ?, ?); end;");
                oraclecallablestatement.registerOutParameter(1, 2);
                oraclecallablestatement.setObject(2, datum, i);
                oraclecallablestatement.setBytes(3, abyte0);
                oraclecallablestatement.setLong(4, l);
                oraclecallablestatement.execute();
                long l3 = oraclecallablestatement.getLong(1);
                return l3;
            }
            finally
            {
                oraclecallablestatement.close();
                oraclecallablestatement = null;
            }
        }
        boolean flag = false;
        long l4 = l;
        boolean flag1 = false;
        long l7 = 0L;
        while(!flag1) 
        {
            if(l1 > (l2 - l4) + 1L)
            {
                return 0L;
            }
            int j = 0;
            int k = (int)Math.min(32512L, l1 - (long)j);
            byte abyte1[] = new byte[k];
            System.arraycopy(abyte0, j, abyte1, 0, k);
            long l5 = plsql_hasPattern(oracleconnection, datum, i, abyte1, l4);
            if(l5 == 0L)
            {
                return 0L;
            }
            l7 = l5;
            j += k;
            l4 = l5 + (long)k;
            boolean flag2 = true;
            while(flag2) 
            {
                int i1 = (int)Math.min(32512L, l1 - (long)j);
                byte abyte2[] = new byte[i1];
                System.arraycopy(abyte0, j, abyte2, 0, i1);
                long l6 = plsql_hasPattern(oracleconnection, datum, i, abyte2, l4);
                if(l6 == l4)
                {
                    j += i1;
                    l4 += i1;
                    if((long)j == l1)
                    {
                        flag2 = false;
                        flag1 = true;
                    }
                } else
                {
                    if(l6 == 0L)
                    {
                        return 0L;
                    }
                    l4 = l6 - (long)j;
                    flag2 = false;
                }
            }
        }
        return l7;
    }

    // Decompiling method: plsql_hasPattern  Signature: (Loracle/sql/BFILE;[BJ)J
    // Max stack: 6, #locals: 4, #params: 4
    // Code length: 13 bytes, Code offset: 9025
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 13 Range 0 12 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 13 Range 0 12 Init 0
    // Parameter  2 added: Name l Type J At 0 13 Range 0 12 Init 0
    // RetValue   4 added: Name <returnValue> Type J At 0 13 Range 0 12 Init 0 fixed
    public static long plsql_hasPattern(BFILE bfile, byte abyte0[], long l)
        throws SQLException
    {
        return plsql_hasPattern(bfile.getConnection(), ((Datum) (bfile)), -13, abyte0, l);
    }

    // Decompiling method: plsql_hasPattern  Signature: (Loracle/sql/BLOB;[BJ)J
    // Max stack: 6, #locals: 4, #params: 4
    // Code length: 14 bytes, Code offset: 9094
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 14 Range 0 13 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 14 Range 0 13 Init 0
    // Parameter  2 added: Name l Type J At 0 14 Range 0 13 Init 0
    // RetValue   4 added: Name <returnValue> Type J At 0 14 Range 0 13 Init 0 fixed
    public static long plsql_hasPattern(BLOB blob, byte abyte0[], long l)
        throws SQLException
    {
        return plsql_hasPattern(blob.getConnection(), ((Datum) (blob)), 2004, abyte0, l);
    }

    // Decompiling method: plsql_hasPattern  Signature: (Loracle/sql/CLOB;[CJ)J
    // Max stack: 6, #locals: 20, #params: 4
    // Code length: 416 bytes, Code offset: 9164
    // Exception table: 1 entries
    //           start  77 end 165 handler 165 type any
    // Line Number Table found: 68 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 416 Range 0 415 Init 0
    // Parameter  1 added: Name ac Type [C At 0 416 Range 0 415 Init 0
    // Parameter  2 added: Name l Type J At 0 416 Range 0 415 Init 0
    // RetValue  20 added: Name <returnValue> Type J At 0 416 Range 0 415 Init 0 fixed
    // LocalVar   4 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 16 283 Range 16 298 Init 16
    // LocalVar   5 added: Name l1 Type J At 21 349 Range 21 369 Init 21
    // LocalVar   7 added: Name l2 Type J At 32 172 Range 32 203 Init 32
    // LocalVar   9 added: Name obj Type A At 75 102 Range 75 176 Init 75
    // LocalVar   9 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 87 90 Range 75 176 Init 75
    // LocalVar  10 added: Name l3 Type J At 157 7 Range 157 163 Init 157
    // LocalVar  13 added: Name local Type @ At 173 12 Range 173 184 Init 173
    // LocalVar   9 added: Name obj Type A At 181 2 Range 181 182 Init 181
    // LocalVar   9 added: Name flag Type Z At 186 2 Range 186 187 Init 186
    // LocalVar  10 added: Name l4 Type J At 189 69 Range 189 257 Init 189
    // LocalVar  12 added: Name flag1 Type Z At 192 218 Range 192 409 Init 192
    // LocalVar  16 added: Name l5 Type J At 195 220 Range 195 414 Init 195
    // LocalVar   9 added: Name flag2 Type Z At 216 62 Range 216 277 Init 216
    // LocalVar   9 chged: Name i Oname flag2 Type I At 226 2 Range 216 277 Init 216
    // LocalVar  18 added: Name j Type I At 234 53 Range 234 286 Init 234
    // LocalVar  15 added: Name ac1 Type [C At 240 16 Range 240 255 Init 240
    // LocalVar  13 added: Name l6 Type J At 261 24 Range 261 284 Init 261
    // LocalVar   9 added: Name k Type I At 281 115 Range 281 395 Init 281
    // LocalVar  19 added: Name flag2 Type Z At 292 113 Range 292 404 Init 292
    // LocalVar  18 added: Name i1 Type I At 313 48 Range 313 360 Init 313
    // LocalVar  15 added: Name ac2 Type [C At 319 16 Range 319 334 Init 319
    // LocalVar  13 added: Name l7 Type J At 340 54 Range 340 393 Init 340
    // LocalVar  12 added: Name exception Type Ljava.lang.Exception; At 165 7 Range 165 171 Init 165
    // LocalVar   9 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    // LocalVar   9 name k(I) merged out into i(I)
    public static long plsql_hasPattern(CLOB clob, char ac[], long l)
        throws SQLException
    {
        if(ac == null || l <= 0L)
        {
            return 0L;
        }
        OracleConnection oracleconnection = clob.getConnection();
        long l1 = ac.length;
        long l2 = plsql_length(oracleconnection, clob, 2005);
        if(l1 == 0L || l1 > (l2 - l) + 1L || l > l2)
        {
            return 0L;
        }
        if(l1 <= (long)getPlsqlMaxInstrSize(oracleconnection))
        {
            OracleCallableStatement oraclecallablestatement = null;
            try
            {
                oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin ? := dbms_lob.instr(?, ?, ?); end;");
                oraclecallablestatement.registerOutParameter(1, 2);
                if(clob.isNCLOB())
                {
                    oraclecallablestatement.setFormOfUse(2, (short)2);
                    oraclecallablestatement.setFormOfUse(3, (short)2);
                }
                oraclecallablestatement.setCLOB(2, clob);
                oraclecallablestatement.setString(3, new String(ac));
                oraclecallablestatement.setLong(4, l);
                oraclecallablestatement.execute();
                long l3 = oraclecallablestatement.getLong(1);
                return l3;
            }
            finally
            {
                oraclecallablestatement.close();
                oraclecallablestatement = null;
            }
        }
        boolean flag = false;
        long l4 = l;
        boolean flag1 = false;
        long l7 = 0L;
        while(!flag1) 
        {
            if(l1 > (l2 - l4) + 1L)
            {
                return 0L;
            }
            int i = 0;
            int j = (int)Math.min(getPlsqlMaxInstrSize(oracleconnection), l1 - (long)i);
            char ac1[] = new char[j];
            System.arraycopy(ac, i, ac1, 0, j);
            long l5 = plsql_hasPattern(clob, ac1, l4);
            if(l5 == 0L)
            {
                return 0L;
            }
            l7 = l5;
            i += j;
            l4 = l5 + (long)j;
            boolean flag2 = true;
            while(flag2) 
            {
                int k = (int)Math.min(getPlsqlMaxInstrSize(oracleconnection), l1 - (long)i);
                char ac2[] = new char[k];
                System.arraycopy(ac, i, ac2, 0, k);
                long l6 = plsql_hasPattern(clob, ac2, l4);
                if(l6 == l4)
                {
                    i += k;
                    l4 += k;
                    if((long)i == l1)
                    {
                        flag2 = false;
                        flag1 = true;
                    }
                } else
                {
                    if(l6 == 0L)
                    {
                        return 0L;
                    }
                    l4 = l6 - (long)i;
                    flag2 = false;
                }
            }
        }
        return l7;
    }

    // Decompiling method: plsql_isLobOpen  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;I)Z
    // Max stack: 3, #locals: 7, #params: 3
    // Code length: 75 bytes, Code offset: 9904
    // Exception table: 1 entries
    //           start  2 end 57 handler 57 type any
    // Line Number Table found: 15 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 75 Range 0 74 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 75 Range 0 74 Init 0
    // Parameter  2 added: Name i Type I At 0 75 Range 0 74 Init 0
    // RetValue   7 added: Name <returnValue> Type Z At 0 75 Range 0 74 Init 0 fixed
    // LocalVar   3 added: Name obj Type A At 1 67 Range 1 67 Init 1
    // LocalVar   3 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 13 55 Range 1 67 Init 1
    // LocalVar   4 added: Name flag Type Z At 49 7 Range 49 55 Init 49
    // LocalVar   6 added: Name local Type @ At 65 10 Range 65 74 Init 65
    // LocalVar   3 added: Name obj Type A At 72 1 Range 72 72 Init 72
    // LocalVar   5 added: Name exception Type Ljava.lang.Exception; At 57 7 Range 57 63 Init 57
    // LocalVar   3 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static boolean plsql_isLobOpen(Connection connection, Datum datum, int i)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin ? := dbms_lob.isOpen(?); end; ");
            oraclecallablestatement.registerOutParameter(1, 2);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(2, (short)2);
            }
            oraclecallablestatement.setOracleObject(2, datum);
            oraclecallablestatement.execute();
            boolean flag = oraclecallablestatement.getBoolean(1);
            return flag;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_isSubLob  Signature: (Loracle/jdbc/driver/OracleConnection;Loracle/sql/Datum;ILoracle/sql/Datum;J)J
    // Max stack: 8, #locals: 21, #params: 6
    // Code length: 340 bytes, Code offset: 10091
    // Line Number Table found: 51 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 340 Range 0 339 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 340 Range 0 339 Init 0
    // Parameter  2 added: Name i Type I At 0 340 Range 0 339 Init 0
    // Parameter  3 added: Name datum1 Type Loracle/sql/Datum; At 0 340 Range 0 339 Init 0
    // Parameter  4 added: Name l Type J At 0 340 Range 0 339 Init 0
    // RetValue  21 added: Name <returnValue> Type J At 0 340 Range 0 339 Init 0 fixed
    // LocalVar   6 added: Name l1 Type J At 19 275 Range 19 293 Init 19
    // LocalVar   8 added: Name l2 Type J At 27 91 Range 27 117 Init 27
    // LocalVar  10 added: Name abyte0 Type [B At 73 19 Range 73 91 Init 73
    // LocalVar  10 added: Name flag Type Z At 99 2 Range 99 100 Init 99
    // LocalVar  11 added: Name l3 Type J At 103 74 Range 103 176 Init 103
    // LocalVar  13 added: Name flag1 Type Z At 106 228 Range 106 333 Init 106
    // LocalVar  17 added: Name l4 Type J At 109 230 Range 109 338 Init 109
    // LocalVar  10 added: Name flag2 Type Z At 130 67 Range 130 196 Init 130
    // LocalVar  10 chged: Name j Oname flag2 Type I At 137 2 Range 130 196 Init 130
    // LocalVar  19 added: Name k Type I At 145 61 Range 145 205 Init 145
    // LocalVar  16 added: Name abyte1 Type [B At 151 24 Range 151 174 Init 151
    // LocalVar  14 added: Name l5 Type J At 180 24 Range 180 203 Init 180
    // LocalVar  10 added: Name i1 Type I At 200 120 Range 200 319 Init 200
    // LocalVar  20 added: Name flag2 Type Z At 211 118 Range 211 328 Init 211
    // LocalVar  19 added: Name j1 Type I At 229 56 Range 229 284 Init 229
    // LocalVar  16 added: Name abyte2 Type [B At 235 24 Range 235 258 Init 235
    // LocalVar  14 added: Name l6 Type J At 264 54 Range 264 317 Init 264
    // LocalVar  10 name i1(I) merged out into j(I)
    public static long plsql_isSubLob(OracleConnection oracleconnection, Datum datum, int i, Datum datum1, long l)
        throws SQLException
    {
        if(datum1 == null || l <= 0L)
        {
            return 0L;
        }
        long l1 = plsql_length(oracleconnection, datum1, i);
        long l2 = plsql_length(oracleconnection, datum, i);
        if(l1 == 0L || l1 > (l2 - l) + 1L || l > l2)
        {
            return 0L;
        }
        if(l1 <= 32512L)
        {
            byte abyte0[] = new byte[(int)l1];
            plsql_read(oracleconnection, datum1, i, 1L, l1, abyte0);
            return plsql_hasPattern(oracleconnection, datum, i, abyte0, l);
        }
        boolean flag = false;
        long l3 = l;
        boolean flag1 = false;
        long l6 = 0L;
        while(!flag1) 
        {
            if(l1 > (l2 - l3) + 1L)
            {
                return 0L;
            }
            int j = 0;
            int k = (int)Math.min(32512L, l1 - (long)j);
            byte abyte1[] = new byte[k];
            plsql_read(oracleconnection, datum1, i, j + 1, k, abyte1);
            long l4 = plsql_hasPattern(oracleconnection, datum, i, abyte1, l3);
            if(l4 == 0L)
            {
                return 0L;
            }
            l6 = l4;
            j += k;
            l3 = l4 + (long)k;
            boolean flag2 = true;
            while(flag2) 
            {
                int i1 = (int)Math.min(32512L, l1 - (long)j);
                byte abyte2[] = new byte[i1];
                plsql_read(oracleconnection, datum1, i, j + 1, i1, abyte2);
                long l5 = plsql_hasPattern(oracleconnection, datum, i, abyte2, l3);
                if(l5 == l3)
                {
                    j += i1;
                    l3 += i1;
                    if((long)j == l1)
                    {
                        flag2 = false;
                        flag1 = true;
                    }
                } else
                {
                    if(l5 == 0L)
                    {
                        return 0L;
                    }
                    l3 = l5 - (long)j;
                    flag2 = false;
                }
            }
        }
        return l6;
    }

    // Decompiling method: plsql_isSubLob  Signature: (Loracle/sql/BFILE;Loracle/sql/BFILE;J)J
    // Max stack: 6, #locals: 4, #params: 4
    // Code length: 13 bytes, Code offset: 10679
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 13 Range 0 12 Init 0
    // Parameter  1 added: Name bfile1 Type Loracle/sql/BFILE; At 0 13 Range 0 12 Init 0
    // Parameter  2 added: Name l Type J At 0 13 Range 0 12 Init 0
    // RetValue   4 added: Name <returnValue> Type J At 0 13 Range 0 12 Init 0 fixed
    public static long plsql_isSubLob(BFILE bfile, BFILE bfile1, long l)
        throws SQLException
    {
        return plsql_isSubLob(bfile.getConnection(), ((Datum) (bfile)), -13, ((Datum) (bfile1)), l);
    }

    // Decompiling method: plsql_isSubLob  Signature: (Loracle/sql/BLOB;Loracle/sql/BLOB;J)J
    // Max stack: 6, #locals: 4, #params: 4
    // Code length: 14 bytes, Code offset: 10748
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 14 Range 0 13 Init 0
    // Parameter  1 added: Name blob1 Type Loracle/sql/BLOB; At 0 14 Range 0 13 Init 0
    // Parameter  2 added: Name l Type J At 0 14 Range 0 13 Init 0
    // RetValue   4 added: Name <returnValue> Type J At 0 14 Range 0 13 Init 0 fixed
    public static long plsql_isSubLob(BLOB blob, BLOB blob1, long l)
        throws SQLException
    {
        return plsql_isSubLob(blob.getConnection(), ((Datum) (blob)), 2004, ((Datum) (blob1)), l);
    }

    // Decompiling method: plsql_isSubLob  Signature: (Loracle/sql/CLOB;Loracle/sql/CLOB;J)J
    // Max stack: 6, #locals: 20, #params: 4
    // Code length: 343 bytes, Code offset: 10818
    // Line Number Table found: 52 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 343 Range 0 342 Init 0
    // Parameter  1 added: Name clob1 Type Loracle/sql/CLOB; At 0 343 Range 0 342 Init 0
    // Parameter  2 added: Name l Type J At 0 343 Range 0 342 Init 0
    // RetValue  20 added: Name <returnValue> Type J At 0 343 Range 0 342 Init 0 fixed
    // LocalVar   4 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 16 207 Range 16 222 Init 16
    // LocalVar   5 added: Name l1 Type J At 27 270 Range 27 296 Init 27
    // LocalVar   7 added: Name l2 Type J At 38 87 Range 38 124 Init 38
    // LocalVar   9 added: Name ac Type [C At 85 16 Range 85 100 Init 85
    // LocalVar   9 added: Name flag Type Z At 107 2 Range 107 108 Init 107
    // LocalVar  10 added: Name l3 Type J At 110 72 Range 110 181 Init 110
    // LocalVar  12 added: Name flag1 Type Z At 113 224 Range 113 336 Init 113
    // LocalVar  16 added: Name l4 Type J At 116 226 Range 116 341 Init 116
    // LocalVar   9 added: Name flag2 Type Z At 137 65 Range 137 201 Init 137
    // LocalVar   9 chged: Name i Oname flag2 Type I At 147 2 Range 137 201 Init 137
    // LocalVar  18 added: Name j Type I At 155 56 Range 155 210 Init 155
    // LocalVar  15 added: Name ac1 Type [C At 161 19 Range 161 179 Init 161
    // LocalVar  13 added: Name l5 Type J At 185 24 Range 185 208 Init 185
    // LocalVar   9 added: Name k Type I At 205 118 Range 205 322 Init 205
    // LocalVar  19 added: Name flag2 Type Z At 216 116 Range 216 331 Init 216
    // LocalVar  18 added: Name i1 Type I At 237 51 Range 237 287 Init 237
    // LocalVar  15 added: Name ac2 Type [C At 243 19 Range 243 261 Init 243
    // LocalVar  13 added: Name l6 Type J At 267 54 Range 267 320 Init 267
    // LocalVar   9 name k(I) merged out into i(I)
    public static long plsql_isSubLob(CLOB clob, CLOB clob1, long l)
        throws SQLException
    {
        if(clob1 == null || l <= 0L)
        {
            return 0L;
        }
        OracleConnection oracleconnection = clob.getConnection();
        long l1 = plsql_length(oracleconnection, clob1, 2005);
        long l2 = plsql_length(oracleconnection, clob, 2005);
        if(l1 == 0L || l1 > (l2 - l) + 1L || l > l2)
        {
            return 0L;
        }
        if(l1 <= (long)getPlsqlMaxInstrSize(oracleconnection))
        {
            char ac[] = new char[(int)l1];
            clob1.getChars(1L, (int)l1, ac);
            return plsql_hasPattern(clob, ac, l);
        }
        boolean flag = false;
        long l3 = l;
        boolean flag1 = false;
        long l6 = 0L;
        while(!flag1) 
        {
            if(l1 > (l2 - l3) + 1L)
            {
                return 0L;
            }
            int i = 0;
            int j = (int)Math.min(getPlsqlMaxInstrSize(oracleconnection), l1 - (long)i);
            char ac1[] = new char[j];
            clob1.getChars(i + 1, j, ac1);
            long l4 = plsql_hasPattern(clob, ac1, l3);
            if(l4 == 0L)
            {
                return 0L;
            }
            l6 = l4;
            i += j;
            l3 = l4 + (long)j;
            boolean flag2 = true;
            while(flag2) 
            {
                int k = (int)Math.min(getPlsqlMaxInstrSize(oracleconnection), l1 - (long)i);
                char ac2[] = new char[k];
                clob1.getChars(i + 1, k, ac2);
                long l5 = plsql_hasPattern(clob, ac2, l3);
                if(l5 == l3)
                {
                    i += k;
                    l3 += k;
                    if((long)i == l1)
                    {
                        flag2 = false;
                        flag1 = true;
                    }
                } else
                {
                    if(l5 == 0L)
                    {
                        return 0L;
                    }
                    l3 = l5 - (long)i;
                    flag2 = false;
                }
            }
        }
        return l6;
    }

    // Decompiling method: plsql_isTemporaryLob  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;I)Z
    // Max stack: 3, #locals: 7, #params: 3
    // Code length: 75 bytes, Code offset: 11413
    // Exception table: 1 entries
    //           start  2 end 57 handler 57 type any
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 75 Range 0 74 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 75 Range 0 74 Init 0
    // Parameter  2 added: Name i Type I At 0 75 Range 0 74 Init 0
    // RetValue   7 added: Name <returnValue> Type Z At 0 75 Range 0 74 Init 0 fixed
    // LocalVar   3 added: Name obj Type A At 1 67 Range 1 67 Init 1
    // LocalVar   3 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 13 55 Range 1 67 Init 1
    // LocalVar   4 added: Name flag Type Z At 49 7 Range 49 55 Init 49
    // LocalVar   6 added: Name local Type @ At 65 10 Range 65 74 Init 65
    // LocalVar   3 added: Name obj Type A At 72 1 Range 72 72 Init 72
    // LocalVar   5 added: Name exception Type Ljava.lang.Exception; At 57 7 Range 57 63 Init 57
    // LocalVar   3 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static boolean plsql_isTemporaryLob(Connection connection, Datum datum, int i)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin ? := dbms_lob.isTemporary (?); end;");
            oraclecallablestatement.registerOutParameter(1, 2);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(2, (short)2);
            }
            oraclecallablestatement.setOracleObject(2, datum);
            oraclecallablestatement.execute();
            boolean flag = oraclecallablestatement.getBoolean(1);
            return flag;
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
    }

    // Decompiling method: plsql_length  Signature: (Loracle/jdbc/driver/OracleConnection;Loracle/sql/Datum;I)J
    // Max stack: 4, #locals: 8, #params: 3
    // Code length: 86 bytes, Code offset: 11596
    // Exception table: 1 entries
    //           start  5 end 58 handler 64 type any
    // Line Number Table found: 16 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 86 Range 0 85 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 86 Range 0 85 Init 0
    // Parameter  2 added: Name i Type I At 0 86 Range 0 85 Init 0
    // RetValue   8 added: Name <returnValue> Type J At 0 86 Range 0 85 Init 0 fixed
    // LocalVar   3 added: Name l Type J At 1 1 Range 1 1 Init 1
    // LocalVar   5 added: Name obj Type A At 3 73 Range 3 75 Init 3
    // LocalVar   5 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 62 Range 3 75 Init 3
    // LocalVar   3 added: Name l1 Type J At 57 28 Range 57 84 Init 57
    // LocalVar   7 added: Name local Type @ At 72 12 Range 72 83 Init 72
    // LocalVar   5 added: Name obj Type A At 80 2 Range 80 81 Init 80
    // LocalVar   6 added: Name exception Type Ljava.lang.Exception; At 64 7 Range 64 70 Init 64
    // LocalVar   3 name l1(J) merged out into l(J)
    // LocalVar   5 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static long plsql_length(OracleConnection oracleconnection, Datum datum, int i)
        throws SQLException
    {
        long l = 0L;
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin ? := dbms_lob.getLength (?); end;");
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(2, (short)2);
            }
            oraclecallablestatement.setObject(2, datum, i);
            oraclecallablestatement.registerOutParameter(1, 2);
            oraclecallablestatement.execute();
            l = oraclecallablestatement.getLong(1);
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return l;
    }

    // Decompiling method: plsql_length  Signature: (Loracle/sql/BFILE;)J
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 11 bytes, Code offset: 11798
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 11 Range 0 10 Init 0
    // RetValue   1 added: Name <returnValue> Type J At 0 11 Range 0 10 Init 0 fixed
    public static long plsql_length(BFILE bfile)
        throws SQLException
    {
        return plsql_length(bfile.getConnection(), ((Datum) (bfile)), -13);
    }

    // Decompiling method: plsql_length  Signature: (Loracle/sql/BLOB;)J
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 12 bytes, Code offset: 11857
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 12 Range 0 11 Init 0
    // RetValue   1 added: Name <returnValue> Type J At 0 12 Range 0 11 Init 0 fixed
    public static long plsql_length(BLOB blob)
        throws SQLException
    {
        return plsql_length(blob.getConnection(), ((Datum) (blob)), 2004);
    }

    // Decompiling method: plsql_length  Signature: (Loracle/sql/CLOB;)J
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 12 bytes, Code offset: 11917
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 12 Range 0 11 Init 0
    // RetValue   1 added: Name <returnValue> Type J At 0 12 Range 0 11 Init 0 fixed
    public static long plsql_length(CLOB clob)
        throws SQLException
    {
        return plsql_length(clob.getConnection(), ((Datum) (clob)), 2005);
    }

    // Decompiling method: plsql_openLob  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;II)V
    // Max stack: 3, #locals: 7, #params: 4
    // Code length: 97 bytes, Code offset: 11977
    // Exception table: 1 entries
    //           start  3 end 70 handler 76 type any
    // Line Number Table found: 16 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 97 Range 0 96 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 97 Range 0 96 Init 0
    // Parameter  2 added: Name i Type I At 0 97 Range 0 96 Init 0
    // Parameter  3 added: Name j Type I At 0 97 Range 0 96 Init 0
    // RetValue   7 added: Name <returnValue> Type V At 0 97 Range 0 96 Init 0 fixed
    // LocalVar   4 added: Name obj Type A At 1 87 Range 1 87 Init 1
    // LocalVar   4 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 14 74 Range 1 87 Init 1
    // LocalVar   6 added: Name local Type @ At 84 12 Range 84 95 Init 84
    // LocalVar   4 added: Name obj Type A At 92 2 Range 92 93 Init 92
    // LocalVar   5 added: Name exception Type Ljava.lang.Exception; At 76 7 Range 76 82 Init 76
    // LocalVar   4 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_openLob(Connection connection, Datum datum, int i, int j)
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin dbms_lob.open (?, ?); end;");
            oraclecallablestatement.registerOutParameter(1, j);
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
            }
            oraclecallablestatement.setOracleObject(1, datum);
            oraclecallablestatement.setInt(2, i);
            oraclecallablestatement.execute();
            datum.setShareBytes(oraclecallablestatement.getOracleObject(1).shareBytes());
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return;
    }

    // Decompiling method: plsql_read  Signature: (Loracle/jdbc/driver/OracleConnection;Loracle/sql/Datum;IJJ[B)J
    // Max stack: 5, #locals: 15, #params: 8
    // Code length: 303 bytes, Code offset: 12190
    // Exception table: 2 entries
    //           start  6 end 208 handler 211 type SQLException
    //           start  6 end 244 handler 250 type any
    // Line Number Table found: 40 entries
    // Parameter  0 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 0 303 Range 0 302 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 303 Range 0 302 Init 0
    // Parameter  2 added: Name i Type I At 0 303 Range 0 302 Init 0
    // Parameter  3 added: Name l Type J At 0 303 Range 0 302 Init 0
    // Parameter  5 added: Name l1 Type J At 0 303 Range 0 302 Init 0
    // Parameter  7 added: Name abyte0 Type [B At 0 303 Range 0 302 Init 0
    // RetValue  15 added: Name <returnValue> Type J At 0 303 Range 0 302 Init 0 fixed
    // LocalVar   8 added: Name obj Type A At 1 261 Range 1 261 Init 1
    // LocalVar   9 added: Name flag Type Z At 4 297 Range 4 300 Init 4
    // LocalVar   8 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 15 247 Range 1 261 Init 1
    // LocalVar  12 added: Name flag1 Type Z At 18 2 Range 18 19 Init 18
    // LocalVar  13 added: Name flag2 Type Z At 21 2 Range 21 22 Init 21
    // LocalVar   9 chged: Name j Oname flag Type I At 199 2 Range 4 300 Init 4
    // LocalVar  11 added: Name local Type @ At 258 41 Range 258 298 Init 258
    // LocalVar   8 added: Name obj Type A At 266 2 Range 266 267 Init 266
    // LocalVar  13 added: Name k Type I At 79 36 Range 79 114 Init 79
    // LocalVar  12 added: Name i1 Type I At 141 55 Range 141 195 Init 141
    // LocalVar  14 added: Name abyte1 Type [B At 149 4 Range 149 152 Init 149
    // LocalVar  12 added: Name sqlexception Type Ljava/sql/SQLException; At 211 15 Range 211 225 Init 211
    // LocalVar  10 added: Name exception Type Ljava.lang.Exception; At 250 7 Range 250 256 Init 250
    // LocalVar   8 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static long plsql_read(OracleConnection oracleconnection, Datum datum, int i, long l, long l1, byte abyte0[])
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        int j = 0;
        try
        {
            oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin dbms_lob.read (?, ?, ?, ?); end;");
            boolean flag = false;
            boolean flag1 = false;
            if(isNCLOB(datum))
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
                oraclecallablestatement.setFormOfUse(4, (short)2);
            }
            oraclecallablestatement.setObject(1, datum, i);
            oraclecallablestatement.registerOutParameter(2, 2);
            oraclecallablestatement.registerOutParameter(4, -3);
            int k;
            for(; (long)j < l1; j += k)
            {
                int i1 = Math.min((int)l1, 32512);
                if(PLSQL_DEBUG)
                {
                    System.out.println("read chunks: chunkSize=" + i1);
                }
                oraclecallablestatement.setInt(2, i1);
                oraclecallablestatement.setInt(3, (int)l + j);
                oraclecallablestatement.execute();
                k = oraclecallablestatement.getInt(2);
                byte abyte1[] = oraclecallablestatement.getBytes(4);
                System.arraycopy(abyte1, 0, abyte0, j, k);
                if(PLSQL_DEBUG)
                {
                    System.out.println("==> sizeRead=" + k);
                }
            }

        }
        catch(SQLException sqlexception)
        {
            if(sqlexception.getErrorCode() != 1403)
            {
                throw sqlexception;
            }
            if(PLSQL_DEBUG)
            {
                System.out.println("end of file");
            }
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
            if(PLSQL_DEBUG)
            {
                System.out.println("end plsql_read =" + j);
            }
        }
        return (long)j;
    }

    // Decompiling method: plsql_read  Signature: (Loracle/sql/BFILE;JJ[B)J
    // Max stack: 8, #locals: 6, #params: 6
    // Code length: 15 bytes, Code offset: 12713
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name bfile Type Loracle/sql/BFILE; At 0 15 Range 0 14 Init 0
    // Parameter  1 added: Name l Type J At 0 15 Range 0 14 Init 0
    // Parameter  3 added: Name l1 Type J At 0 15 Range 0 14 Init 0
    // Parameter  5 added: Name abyte0 Type [B At 0 15 Range 0 14 Init 0
    // RetValue   6 added: Name <returnValue> Type J At 0 15 Range 0 14 Init 0 fixed
    public static long plsql_read(BFILE bfile, long l, long l1, byte abyte0[])
        throws SQLException
    {
        return plsql_read(bfile.getConnection(), ((Datum) (bfile)), -13, l, l1, abyte0);
    }

    // Decompiling method: plsql_read  Signature: (Loracle/sql/BLOB;JJ[B)J
    // Max stack: 8, #locals: 6, #params: 6
    // Code length: 16 bytes, Code offset: 12784
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 16 Range 0 15 Init 0
    // Parameter  1 added: Name l Type J At 0 16 Range 0 15 Init 0
    // Parameter  3 added: Name l1 Type J At 0 16 Range 0 15 Init 0
    // Parameter  5 added: Name abyte0 Type [B At 0 16 Range 0 15 Init 0
    // RetValue   6 added: Name <returnValue> Type J At 0 16 Range 0 15 Init 0 fixed
    public static long plsql_read(BLOB blob, long l, long l1, byte abyte0[])
        throws SQLException
    {
        return plsql_read(blob.getConnection(), ((Datum) (blob)), 2004, l, l1, abyte0);
    }

    // Decompiling method: plsql_read  Signature: (Loracle/sql/CLOB;JJ[C)J
    // Max stack: 5, #locals: 21, #params: 6
    // Code length: 327 bytes, Code offset: 12856
    // Exception table: 2 entries
    //           start  9 end 278 handler 281 type SQLException
    //           start  9 end 297 handler 303 type any
    // Line Number Table found: 57 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 327 Range 0 326 Init 0
    // Parameter  1 added: Name l Type J At 0 327 Range 0 326 Init 0
    // Parameter  3 added: Name l1 Type J At 0 327 Range 0 326 Init 0
    // Parameter  5 added: Name ac Type [C At 0 327 Range 0 326 Init 0
    // RetValue  21 added: Name <returnValue> Type J At 0 327 Range 0 326 Init 0 fixed
    // LocalVar   6 added: Name obj Type A At 1 314 Range 1 314 Init 1
    // LocalVar   7 added: Name flag Type Z At 4 321 Range 4 324 Init 4
    // LocalVar   8 added: Name flag1 Type Z At 7 141 Range 7 147 Init 7
    // LocalVar  11 added: Name obj1 Type A At 10 2 Range 10 11 Init 10
    // LocalVar  12 added: Name flag2 Type Z At 13 2 Range 13 14 Init 13
    // LocalVar  13 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 19 36 Range 19 54 Init 19
    // LocalVar  14 added: Name dbconversion Type Loracle/jdbc/dbaccess/DBConversion; At 26 200 Range 26 225 Init 26
    // LocalVar  15 added: Name flag3 Type Z At 36 4 Range 36 39 Init 36
    // LocalVar   8 chged: Name i Oname flag1 Type I At 51 97 Range 7 147 Init 7
    // LocalVar   6 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 63 252 Range 1 314 Init 1
    // LocalVar  16 added: Name flag1 Type Z At 66 2 Range 66 67 Init 66
    // LocalVar  17 added: Name flag4 Type Z At 69 2 Range 69 70 Init 69
    // LocalVar  18 added: Name obj Type A At 72 2 Range 72 73 Init 72
    // LocalVar  19 added: Name ac1 Type [C At 79 174 Range 79 252 Init 79
    // LocalVar   7 chged: Name j Oname flag Type I At 270 2 Range 4 324 Init 4
    // LocalVar  10 added: Name local Type @ At 311 12 Range 311 322 Init 311
    // LocalVar   6 added: Name obj2 Type A At 319 2 Range 319 320 Init 319
    // LocalVar  17 added: Name k Type I At 154 7 Range 154 160 Init 154
    // LocalVar  16 added: Name i1 Type I At 187 80 Range 187 266 Init 187
    // LocalVar  18 added: Name abyte0 Type [B At 195 35 Range 195 229 Init 195
    // LocalVar  20 added: Name flag Type Z At 198 2 Range 198 199 Init 198
    // LocalVar  20 added: Name j1 Type I At 219 21 Range 219 239 Init 219
    // LocalVar  11 added: Name sqlexception Type Ljava/sql/SQLException; At 281 15 Range 281 295 Init 281
    // LocalVar   9 added: Name exception Type Ljava.lang.Exception; At 303 7 Range 303 309 Init 303
    // LocalVar   6 name obj2(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    // LocalVar  20 chged: Name k1 Oname flag Type I At 198 2 Range 198 199 Init 198
    // LocalVar  20 name j1(I) merged out into k1(I)
    public static long plsql_read(CLOB clob, long l, long l1, char ac[])
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        int i = 0;
        int j = 1;
        try
        {
            Object obj = null;
            boolean flag = false;
            OracleConnection oracleconnection = clob.getConnection();
            DBConversion dbconversion = oracleconnection.conversion;
            boolean flag1 = DBConversion.isCharSetMultibyte(dbconversion.getAccessCharSet());
            if(flag1)
            {
                j = oracleconnection.db_access.getNlsRatio();
            }
            oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin dbms_lob.read(?, ?, ?, ?); end;");
            boolean flag2 = false;
            boolean flag3 = false;
            Object obj1 = null;
            char ac1[] = new char[32512];
            if(clob.isNCLOB())
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
                oraclecallablestatement.setFormOfUse(4, (short)2);
                if(dbconversion.IsNCharFixedWith())
                {
                    j = 2;
                }
            }
            oraclecallablestatement.setCLOB(1, clob);
            oraclecallablestatement.registerOutParameter(2, 2);
            oraclecallablestatement.registerOutParameter(4, 12);
            int k;
            for(; (long)i < l1; i += k)
            {
                int i1 = (int)Math.min(l1 - (long)i, 32512 / j);
                oraclecallablestatement.setInt(2, i1);
                oraclecallablestatement.setInt(3, (int)l + i);
                oraclecallablestatement.execute();
                k = oraclecallablestatement.getInt(2);
                byte abyte0[] = oraclecallablestatement.getBytes(4);
                int j1 = 0;
                if(clob.isNCLOB())
                {
                    j1 = dbconversion.NCHARBytesToJavaChars(abyte0, abyte0.length, ac1);
                } else
                {
                    j1 = dbconversion.CHARBytesToJavaChars(abyte0, abyte0.length, ac1);
                }
                if(j1 != k)
                {
                    DBError.check_error(37, null);
                }
                System.arraycopy(ac1, 0, ac, i, k);
            }

        }
        catch(SQLException sqlexception)
        {
            if(sqlexception.getErrorCode() != 1403)
            {
                throw sqlexception;
            }
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return (long)i;
    }

    // Decompiling method: plsql_trimLob  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;IJ)V
    // Max stack: 4, #locals: 8, #params: 5
    // Code length: 72 bytes, Code offset: 13471
    // Line Number Table found: 12 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 72 Range 0 71 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 72 Range 0 71 Init 0
    // Parameter  2 added: Name i Type I At 0 72 Range 0 71 Init 0
    // Parameter  3 added: Name l Type J At 0 72 Range 0 71 Init 0
    // RetValue   8 added: Name <returnValue> Type V At 0 72 Range 0 71 Init 0 fixed
    // LocalVar   5 added: Name l1 Type J At 1 2 Range 1 2 Init 1
    // LocalVar   7 added: Name obj Type A At 4 2 Range 4 5 Init 4
    // LocalVar   7 added: Name oraclecallablestatement Type Loracle/jdbc/driver/OracleCallableStatement; At 17 47 Range 17 63 Init 17
    // LocalVar   7 chged: Name oraclecallablestatement1 Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 4 2 Range 4 5 Init 4
    // LocalVar   7 name oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;) merged out into oraclecallablestatement1(Loracle/jdbc/driver/OracleCallableStatement;)
    public static void plsql_trimLob(Connection connection, Datum datum, int i, long l)
        throws SQLException
    {
        long l1 = 0L;
        OracleCallableStatement oraclecallablestatement = null;
        oraclecallablestatement = (OracleCallableStatement)connection.prepareCall("begin dbms_lob.trim (?, ?); end;");
        oraclecallablestatement.registerOutParameter(1, i);
        if(isNCLOB(datum))
        {
            oraclecallablestatement.setFormOfUse(1, (short)2);
        }
        oraclecallablestatement.setObject(1, datum, i);
        oraclecallablestatement.setLong(2, l);
        oraclecallablestatement.execute();
        datum.setShareBytes(oraclecallablestatement.getBytes(1));
        return;
    }

    // Decompiling method: plsql_write  Signature: (Ljava/sql/Connection;Loracle/sql/Datum;IJ[BJJ)J
    // Max stack: 2, #locals: 10, #params: 10
    // Code length: 2 bytes, Code offset: 13635
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 2 Range 0 1 Init 0
    // Parameter  1 added: Name datum Type Loracle/sql/Datum; At 0 2 Range 0 1 Init 0
    // Parameter  2 added: Name i Type I At 0 2 Range 0 1 Init 0
    // Parameter  3 added: Name l Type J At 0 2 Range 0 1 Init 0
    // Parameter  5 added: Name abyte0 Type [B At 0 2 Range 0 1 Init 0
    // Parameter  6 added: Name l1 Type J At 0 2 Range 0 1 Init 0
    // Parameter  8 added: Name l2 Type J At 0 2 Range 0 1 Init 0
    // RetValue  10 added: Name <returnValue> Type J At 0 2 Range 0 1 Init 0 fixed
    public static long plsql_write(Connection connection, Datum datum, int i, long l, byte abyte0[], long l1, 
            long l2)
        throws SQLException
    {
        return 0L;
    }

    // Decompiling method: plsql_write  Signature: (Loracle/sql/BLOB;J[B)J
    // Max stack: 5, #locals: 11, #params: 4
    // Code length: 173 bytes, Code offset: 13685
    // Exception table: 1 entries
    //           start  24 end 143 handler 149 type any
    // Line Number Table found: 25 entries
    // Parameter  0 added: Name blob Type Loracle/sql/BLOB; At 0 173 Range 0 172 Init 0
    // Parameter  1 added: Name l Type J At 0 173 Range 0 172 Init 0
    // Parameter  3 added: Name abyte0 Type [B At 0 173 Range 0 172 Init 0
    // RetValue  11 added: Name <returnValue> Type J At 0 173 Range 0 172 Init 0 fixed
    // LocalVar   4 added: Name i Type I At 2 138 Range 2 139 Init 2
    // LocalVar   5 added: Name obj Type A At 5 2 Range 5 6 Init 5
    // LocalVar   6 added: Name flag Type Z At 8 163 Range 8 170 Init 8
    // LocalVar   5 added: Name oraclecallablestatement Type Loracle/jdbc/driver/OracleCallableStatement; At 22 139 Range 22 160 Init 22
    // LocalVar   9 added: Name j Type I At 32 4 Range 32 35 Init 32
    // LocalVar  10 added: Name abyte1 Type [B At 38 69 Range 38 106 Init 38
    // LocalVar   6 chged: Name k Oname flag Type I At 136 2 Range 8 170 Init 8
    // LocalVar   8 added: Name local Type @ At 157 12 Range 157 168 Init 157
    // LocalVar   5 added: Name obj1 Type A At 165 2 Range 165 166 Init 165
    // LocalVar   9 added: Name i1 Type I At 63 57 Range 63 119 Init 63
    // LocalVar   7 added: Name exception Type Ljava.lang.Exception; At 149 7 Range 149 155 Init 149
    // LocalVar   5 chged: Name oraclecallablestatement1 Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 5 2 Range 5 6 Init 5
    // LocalVar   5 name oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;) merged out into oraclecallablestatement1(Loracle/jdbc/driver/OracleCallableStatement;)
    // LocalVar   5 name obj1(A) merged out into oraclecallablestatement1(Loracle/jdbc/driver/OracleCallableStatement;)
    public static long plsql_write(BLOB blob, long l, byte abyte0[])
        throws SQLException
    {
        int i = abyte0.length;
        OracleCallableStatement oraclecallablestatement = null;
        int j = 0;
        oraclecallablestatement = (OracleCallableStatement)blob.getConnection().prepareCall("begin dbms_lob.write (?, ?, ?, ?); end;");
        try
        {
            int k = Math.min(i, 32512);
            byte abyte1[] = new byte[k];
            oraclecallablestatement.registerOutParameter(1, 2004);
            while(j < i) 
            {
                int i1 = Math.min(i - j, 32512);
                System.arraycopy(abyte0, j, abyte1, 0, i1);
                oraclecallablestatement.setBLOB(1, blob);
                oraclecallablestatement.setInt(2, i1);
                oraclecallablestatement.setInt(3, (int)l + j);
                oraclecallablestatement.setBytes(4, abyte1);
                oraclecallablestatement.execute();
                j += i1;
                blob.setLocator(oraclecallablestatement.getBLOB(1).getLocator());
            }
        }
        finally
        {
            oraclecallablestatement.close();
            oraclecallablestatement = null;
        }
        return (long)j;
    }

    // Decompiling method: plsql_write  Signature: (Loracle/sql/CLOB;J[C)J
    // Max stack: 5, #locals: 33, #params: 4
    // Code length: 799 bytes, Code offset: 14010
    // Exception table: 1 entries
    //           start  22 end 764 handler 770 type any
    // Line Number Table found: 127 entries
    // Parameter  0 added: Name clob Type Loracle/sql/CLOB; At 0 799 Range 0 798 Init 0
    // Parameter  1 added: Name l Type J At 0 799 Range 0 798 Init 0
    // Parameter  3 added: Name ac Type [C At 0 799 Range 0 798 Init 0
    // RetValue  33 added: Name <returnValue> Type J At 0 799 Range 0 798 Init 0 fixed
    // LocalVar   4 added: Name obj Type A At 1 786 Range 1 786 Init 1
    // LocalVar   5 added: Name oracleconnection Type Loracle/jdbc/driver/OracleConnection; At 7 187 Range 7 193 Init 7
    // LocalVar   6 added: Name i Type I At 11 750 Range 11 760 Init 11
    // LocalVar   7 added: Name flag Type Z At 14 783 Range 14 796 Init 14
    // LocalVar   8 added: Name flag1 Type Z At 17 2 Range 17 18 Init 17
    // LocalVar   9 added: Name flag2 Type Z At 20 2 Range 20 21 Init 20
    // LocalVar  12 added: Name obj1 Type A At 23 2 Range 23 24 Init 23
    // LocalVar  13 added: Name flag3 Type Z At 26 2 Range 26 27 Init 26
    // LocalVar  14 added: Name dbconversion Type Loracle/jdbc/dbaccess/DBConversion; At 33 513 Range 33 545 Init 33
    // LocalVar  15 added: Name flag4 Type Z At 43 39 Range 43 81 Init 43
    // LocalVar   4 chged: Name oraclecallablestatement Oname obj Type Loracle/jdbc/driver/OracleCallableStatement; At 55 732 Range 1 786 Init 1
    // LocalVar   7 chged: Name j Oname flag Type I At 182 2 Range 14 796 Init 14
    // LocalVar  16 added: Name k Type I At 200 39 Range 200 238 Init 200
    // LocalVar  17 added: Name i1 Type I At 207 215 Range 207 421 Init 207
    // LocalVar  18 added: Name j1 Type I At 240 437 Range 240 676 Init 240
    // LocalVar  19 added: Name k1 Type I At 252 138 Range 252 389 Init 252
    // LocalVar  20 added: Name l1 Type I At 258 150 Range 258 407 Init 258
    // LocalVar  21 added: Name byte0 Type B At 262 178 Range 262 439 Init 262
    // LocalVar  22 added: Name abyte0 Type [B At 271 300 Range 271 570 Init 271
    // LocalVar  23 added: Name ac1 Type [C At 277 271 Range 277 547 Init 277
    // LocalVar  24 added: Name flag Type Z At 280 236 Range 280 515 Init 280
    // LocalVar  25 added: Name flag5 Type Z At 283 84 Range 283 366 Init 283
    // LocalVar  26 added: Name flag6 Type Z At 286 91 Range 286 376 Init 286
    // LocalVar  27 added: Name flag7 Type Z At 289 2 Range 289 290 Init 289
    // LocalVar  28 added: Name flag8 Type Z At 292 2 Range 292 293 Init 292
    // LocalVar  29 added: Name flag9 Type Z At 295 2 Range 295 296 Init 295
    // LocalVar  30 added: Name flag10 Type Z At 298 2 Range 298 299 Init 298
    // LocalVar  11 added: Name local Type @ At 778 17 Range 778 794 Init 778
    // LocalVar   4 added: Name obj Type A At 791 2 Range 791 792 Init 791
    // LocalVar  13 added: Name i2 Type I At 124 42 Range 124 165 Init 124
    // LocalVar  12 added: Name s Type Ljava/lang/String; At 138 15 Range 138 152 Init 138
    // LocalVar  29 added: Name flag11 Type Z At 322 299 Range 322 620 Init 322
    // LocalVar  27 added: Name flag12 Type Z At 325 261 Range 325 585 Init 325
    // LocalVar  28 added: Name flag13 Type Z At 328 399 Range 328 726 Init 328
    // LocalVar  31 added: Name bytearrayoutputstream Type Ljava/io/ByteArrayOutputStream; At 337 294 Range 337 630 Init 337
    // LocalVar  30 added: Name flag14 Type Z At 340 45 Range 340 384 Init 340
    // LocalVar  28 chged: Name j2 Oname flag13 Type I At 624 2 Range 328 726 Init 328
    // LocalVar  32 added: Name abyte1 Type [B At 634 79 Range 634 712 Init 634
    // LocalVar  25 chged: Name k2 Oname flag5 Type I At 358 2 Range 283 366 Init 283
    // LocalVar  27 chged: Name l2 Oname flag12 Type I At 363 2 Range 325 585 Init 325
    // LocalVar  26 chged: Name i3 Oname flag6 Type I At 375 2 Range 286 376 Init 286
    // LocalVar  26 added: Name flag5 Type Z At 381 2 Range 381 382 Init 381
    // LocalVar  24 chged: Name j3 Oname flag Type I At 392 2 Range 280 515 Init 280
    // LocalVar  26 name flag5(Z) merged out into i3(I)
    // LocalVar  32 added: Name flag Type Z At 487 22 Range 487 508 Init 487
    // LocalVar  32 chged: Name k3 Oname flag Type I At 507 2 Range 487 508 Init 487
    // LocalVar  10 added: Name exception Type Ljava.lang.Exception; At 770 7 Range 770 776 Init 770
    // LocalVar   4 name obj(A) merged out into oraclecallablestatement(Loracle/jdbc/driver/OracleCallableStatement;)
    public static long plsql_write(CLOB clob, long l, char ac[])
        throws SQLException
    {
        OracleCallableStatement oraclecallablestatement = null;
        OracleConnection oracleconnection = clob.getConnection();
        int i = ac.length;
        int j = 0;
        boolean flag = false;
        boolean flag1 = false;
        try
        {
            Object obj = null;
            boolean flag2 = false;
            DBConversion dbconversion = oracleconnection.conversion;
            boolean flag3 = DBConversion.isCharSetMultibyte(dbconversion.getAccessCharSet());
            oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin dbms_lob.write (?, ?, ?, ?); end;");
            if(clob.isNCLOB())
            {
                oraclecallablestatement.setFormOfUse(1, (short)2);
            }
            oraclecallablestatement.registerOutParameter(1, 2005);
            if(!flag3 && !clob.isNCLOB())
            {
                while(j < i) 
                {
                    oraclecallablestatement.setCLOB(1, clob);
                    oraclecallablestatement.setInt(3, (int)l + j);
                    int k = Math.min(i - j, 32512);
                    String s = new String(ac, j, k);
                    oraclecallablestatement.setInt(2, k);
                    oraclecallablestatement.setString(4, s);
                    oraclecallablestatement.execute();
                    j += k;
                    clob.setLocator(oraclecallablestatement.getCLOB(1).getLocator());
                }
            } else
            {
                int i1 = oracleconnection.db_access.getC2SNlsRatio();
                int j1 = dbconversion.getMaxCharbyteSize();
                if(clob.isNCLOB())
                {
                    j1 = dbconversion.getMaxNCharbyteSize();
                    if(dbconversion.IsNCharFixedWith())
                    {
                        i1 = 2;
                    }
                }
                int k1 = 32512 / i1;
                int l1 = Math.min(k1 / j1, i);
                int i2 = l1 / 3;
                byte byte0 = 100;
                byte abyte0[] = new byte[l1 * j1];
                char ac1[] = new char[l1];
                int j2 = 0;
                int k2 = 0;
                int l2 = 0;
                boolean flag4 = false;
                boolean flag5 = false;
                boolean flag6 = false;
                boolean flag8 = true;
                while(j < i) 
                {
                    oraclecallablestatement.setCLOB(1, clob);
                    oraclecallablestatement.setInt(3, (int)l + j);
                    boolean flag7 = false;
                    int i3 = 0;
                    int j3 = 0;
                    ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
                    boolean flag9 = true;
                    while(!flag7) 
                    {
                        if(k2 != 0)
                        {
                            flag9 = false;
                            bytearrayoutputstream.write(abyte0, 0, k2);
                            i3 += k2;
                            k2 = 0;
                            j3 += l2;
                            l2 = 0;
                        }
                        if(flag9)
                        {
                            l2 = Math.min(l1, i - j2);
                            flag9 = false;
                        } else
                        {
                            l2 = Math.min(i2, i - j2);
                            if(l2 * j1 + i3 > k1 && l2 > byte0)
                            {
                                l2 = byte0;
                            }
                        }
                        if(PLSQL_DEBUG)
                        {
                            System.out.println("while !done    " + l2 + " " + j3);
                        }
                        if(l2 > 0)
                        {
                            for(int k3 = 0; k3 < l2; k3++)
                            {
                                ac1[k3] = ac[j2 + k3];
                            }

                            j2 += l2;
                            if(clob.isNCLOB())
                            {
                                k2 = dbconversion.javaCharsToNCHARBytes(ac1, l2, abyte0);
                            } else
                            {
                                k2 = dbconversion.javaCharsToCHARBytes(ac1, l2, abyte0);
                            }
                            if(i3 + k2 <= k1)
                            {
                                bytearrayoutputstream.write(abyte0, 0, k2);
                                j3 += l2;
                                i3 += k2;
                                k2 = 0;
                                l2 = 0;
                                if(i3 == k1)
                                {
                                    flag7 = true;
                                }
                            } else
                            {
                                flag7 = true;
                            }
                        } else
                        {
                            flag7 = true;
                        }
                    }
                    if(j3 > 0)
                    {
                        byte abyte1[] = bytearrayoutputstream.toByteArray();
                        if(PLSQL_DEBUG)
                        {
                            System.out.println("execute  .... " + j3 + " " + abyte1.length + " " + k1);
                        }
                        oraclecallablestatement.setInt(2, j3);
                        if(clob.isNCLOB())
                        {
                            oraclecallablestatement.setFormOfUse(4, (short)2);
                        }
                        oraclecallablestatement.setInternalBytes(4, abyte1, 1);
                        oraclecallablestatement.execute();
                        j += j3;
                        clob.setLocator(oraclecallablestatement.getCLOB(1).getLocator());
                    } else
                    if(j < i)
                    {
                        DBError.throwSqlException(1);
                    }
                }
            }
        }
        finally
        {
            if(oraclecallablestatement != null)
            {
                oraclecallablestatement.close();
                oraclecallablestatement = null;
            }
        }
        return (long)j;
    }

    // Decompiling method: <clinit>  Signature: ()V
    // Max stack: 1, #locals: 0, #params: 0
    // Code length: 5 bytes, Code offset: 5986
    // Line Number Table found: 2 entries
    // RetValue   0 added: Name <returnValue> Type V At 0 5 Range 0 4 Init 0 fixed
    static 
    {
        /* PLSQL_DEBUG = false; */
    }
}
