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

package oracle.sql;

import java.sql.Connection;
import java.sql.Date;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.TimeZone;
import oracle.jdbc.OracleConnection;

// Referenced classes of package oracle.sql:
//            Datum, DATE, OffsetDST, TIMEZONETAB, 
//            ZONEIDMAP

// flag ACC_SUPER is set
public class TIMESTAMPTZ extends Datum
{
    // Constants:          328
    // Interfaces:         0
    // Fields:             15
    // Methods:            37
    // Class Attributes:   1


    private static int CENTURY_DEFAULT = 119;
    private static int DECADE_DEFAULT = 100;
    private static int MONTH_DEFAULT = 1;
    private static int DAY_DEFAULT = 1;
    private static int DECADE_INIT = 170;
    private static int HOUR_MILLISECOND = 0x36ee80;
    private static int MINUTE_MILLISECOND = 60000;
    private static int JAVA_YEAR = 1970;
    private static int JAVA_MONTH = 0;
    private static int JAVA_DATE = 1;
    private static int SIZE_TIMESTAMPTZ = 13;
    private static int SIZE_TIMESTAMP = 11;
    private static int OFFSET_HOUR = 20;
    private static int OFFSET_MINUTE = 60;
    private static byte REGIONIDBIT = -128;

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

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/lang/String;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 4512
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 10 Range 0 9 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name s Type Ljava/lang/String; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 10 Range 0 9 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, String s)
        throws SQLException
    {
        super(toBytes(connection, s));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/lang/String;Ljava/util/Calendar;)V
    // Max stack: 4, #locals: 4, #params: 4
    // Code length: 11 bytes, Code offset: 4574
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 11 Range 0 10 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 11 Range 0 10 Init 0
    // Parameter  2 added: Name s Type Ljava/lang/String; At 0 11 Range 0 10 Init 0
    // Parameter  3 added: Name calendar Type Ljava/util/Calendar; At 0 11 Range 0 10 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 11 Range 0 10 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, String s, Calendar calendar)
        throws SQLException
    {
        super(toBytes(connection, s, calendar));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Date;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 4637
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 10 Range 0 9 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name date Type Ljava/sql/Date; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 10 Range 0 9 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Date date)
        throws SQLException
    {
        super(toBytes(connection, date));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Date;Ljava/util/Calendar;)V
    // Max stack: 4, #locals: 4, #params: 4
    // Code length: 11 bytes, Code offset: 4699
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 11 Range 0 10 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 11 Range 0 10 Init 0
    // Parameter  2 added: Name date Type Ljava/sql/Date; At 0 11 Range 0 10 Init 0
    // Parameter  3 added: Name calendar Type Ljava/util/Calendar; At 0 11 Range 0 10 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 11 Range 0 10 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Date date, Calendar calendar)
        throws SQLException
    {
        super(toBytes(connection, date, calendar));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Time;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 4762
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 10 Range 0 9 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name time Type Ljava/sql/Time; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 10 Range 0 9 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Time time)
        throws SQLException
    {
        super(toBytes(connection, time));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Time;Ljava/util/Calendar;)V
    // Max stack: 4, #locals: 4, #params: 4
    // Code length: 11 bytes, Code offset: 4824
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 11 Range 0 10 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 11 Range 0 10 Init 0
    // Parameter  2 added: Name time Type Ljava/sql/Time; At 0 11 Range 0 10 Init 0
    // Parameter  3 added: Name calendar Type Ljava/util/Calendar; At 0 11 Range 0 10 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 11 Range 0 10 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Time time, Calendar calendar)
        throws SQLException
    {
        super(toBytes(connection, time, calendar));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Timestamp;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 4887
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 10 Range 0 9 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name timestamp Type Ljava/sql/Timestamp; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 10 Range 0 9 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Timestamp timestamp)
        throws SQLException
    {
        super(toBytes(connection, timestamp));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Ljava/sql/Timestamp;Ljava/util/Calendar;)V
    // Max stack: 4, #locals: 4, #params: 4
    // Code length: 11 bytes, Code offset: 4949
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 11 Range 0 10 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 11 Range 0 10 Init 0
    // Parameter  2 added: Name timestamp Type Ljava/sql/Timestamp; At 0 11 Range 0 10 Init 0
    // Parameter  3 added: Name calendar Type Ljava/util/Calendar; At 0 11 Range 0 10 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 11 Range 0 10 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, Timestamp timestamp, Calendar calendar)
        throws SQLException
    {
        super(toBytes(connection, timestamp, calendar));
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/sql/Connection;Loracle/sql/DATE;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 5012
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 10 Range 0 9 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name date Type Loracle/sql/DATE; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 10 Range 0 9 Init 0 fixed
    public TIMESTAMPTZ(Connection connection, DATE date)
        throws SQLException
    {
        super(toBytes(connection, date));
        return;
    }

    // Decompiling method: <init>  Signature: ([B)V
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 6 bytes, Code offset: 5074
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; 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 TIMESTAMPTZ(byte abyte0[])
    {
        super(abyte0);
        return;
    }

    // Decompiling method: getHighOrderbits  Signature: (I)I
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 5122
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name i Type I At 0 8 Range 0 7 Init 0
    // RetValue   1 added: Name <returnValue> Type I At 0 8 Range 0 7 Init 0 fixed
    private static int getHighOrderbits(int i)
    {
        return (i & 0x7f) << 6;
    }

    // Decompiling method: getJavaYear  Signature: (II)I
    // Max stack: 3, #locals: 2, #params: 2
    // Code length: 13 bytes, Code offset: 5168
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name i Type I At 0 13 Range 0 12 Init 0
    // Parameter  1 added: Name j Type I At 0 13 Range 0 12 Init 0
    // RetValue   2 added: Name <returnValue> Type I At 0 13 Range 0 12 Init 0 fixed
    private static int getJavaYear(int i, int j)
    {
        return (i - 100) * 100 + (j - 100);
    }

    // Decompiling method: getLowOrderbits  Signature: (I)I
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 5219
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name i Type I At 0 8 Range 0 7 Init 0
    // RetValue   1 added: Name <returnValue> Type I At 0 8 Range 0 7 Init 0 fixed
    private static int getLowOrderbits(int i)
    {
        return (i & 0xfc) >> 2;
    }

    // Decompiling method: initTimestamptz  Signature: ()[B
    // Max stack: 4, #locals: 3, #params: 0
    // Code length: 123 bytes, Code offset: 5265
    // Line Number Table found: 18 entries
    // RetValue   3 added: Name <returnValue> Type [B At 0 123 Range 0 122 Init 0 fixed
    // LocalVar   0 added: Name abyte0 Type [B At 5 117 Range 5 121 Init 5
    // LocalVar   1 added: Name calendar Type Ljava/util/Calendar; At 9 67 Range 9 75 Init 9
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 85 28 Range 85 112 Init 85
    private static byte[] initTimestamptz()
    {
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        Calendar calendar = Calendar.getInstance();
        abyte0[0] = (byte)CENTURY_DEFAULT;
        abyte0[1] = (byte)DECADE_INIT;
        abyte0[2] = (byte)MONTH_DEFAULT;
        abyte0[3] = (byte)DAY_DEFAULT;
        abyte0[4] = 1;
        abyte0[5] = 1;
        abyte0[6] = 1;
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        String s = new String(calendar.getTimeZone().getID());
        abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s));
        abyte0[11] |= REGIONIDBIT;
        abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s));
        return abyte0;
    }

    // Decompiling method: isConvertibleTo  Signature: (Ljava/lang/Class;)Z
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 52 bytes, Code offset: 5494
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 52 Range 0 51 Init 0 fixed
    // Parameter  1 added: Name class1 Type Ljava/lang/Class; At 0 52 Range 0 51 Init 0
    // RetValue   2 added: Name <returnValue> Type Z At 0 52 Range 0 51 Init 0 fixed
    public boolean isConvertibleTo(Class class1)
    {
        return class1.getName().compareTo("java.sql.Date") == 0 || class1.getName().compareTo("java.sql.Time") == 0 || class1.getName().compareTo("java.sql.Timestamp") == 0 || class1.getName().compareTo("java.lang.String") == 0;
    }

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

    // Decompiling method: setHighOrderbits  Signature: (I)I
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 9 bytes, Code offset: 5653
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name i Type I At 0 9 Range 0 8 Init 0
    // RetValue   1 added: Name <returnValue> Type I At 0 9 Range 0 8 Init 0 fixed
    private static int setHighOrderbits(int i)
    {
        return (i & 0x1fc0) >> 6;
    }

    // Decompiling method: setLowOrderbits  Signature: (I)I
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 7 bytes, Code offset: 5700
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name i Type I At 0 7 Range 0 6 Init 0
    // RetValue   1 added: Name <returnValue> Type I At 0 7 Range 0 6 Init 0 fixed
    private static int setLowOrderbits(int i)
    {
        return (i & 0x3f) << 2;
    }

    // Decompiling method: timestampValue  Signature: (Ljava/sql/Connection;)Ljava/sql/Timestamp;
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 9 bytes, Code offset: 5745
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 9 Range 0 8 Init 0 fixed
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 9 Range 0 8 Init 0
    // RetValue   2 added: Name <returnValue> Type Ljava/sql/Timestamp; At 0 9 Range 0 8 Init 0 fixed
    public Timestamp timestampValue(Connection connection)
        throws SQLException
    {
        return toTimestamp(connection, getBytes());
    }

    // Decompiling method: toBytes  Signature: ()[B
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 5802
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; At 0 5 Range 0 4 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [B At 0 5 Range 0 4 Init 0 fixed
    public byte[] toBytes()
    {
        return getBytes();
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/lang/String;)[B
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 9 bytes, Code offset: 5845
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 9 Range 0 8 Init 0
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 9 Range 0 8 Init 0
    // RetValue   2 added: Name <returnValue> Type [B At 0 9 Range 0 8 Init 0 fixed
    public static byte[] toBytes(Connection connection, String s)
        throws SQLException
    {
        return toBytes(connection, Timestamp.valueOf(s));
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/lang/String;Ljava/util/Calendar;)[B
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 10 bytes, Code offset: 5902
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 10 Range 0 9 Init 0
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 10 Range 0 9 Init 0
    // Parameter  2 added: Name calendar Type Ljava/util/Calendar; At 0 10 Range 0 9 Init 0
    // RetValue   3 added: Name <returnValue> Type [B At 0 10 Range 0 9 Init 0 fixed
    public static byte[] toBytes(Connection connection, String s, Calendar calendar)
        throws SQLException
    {
        return toBytes(connection, Timestamp.valueOf(s), calendar);
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Date;)[B
    // Max stack: 4, #locals: 11, #params: 2
    // Code length: 455 bytes, Code offset: 5960
    // Line Number Table found: 54 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 455 Range 0 454 Init 0
    // Parameter  1 added: Name date Type Ljava/sql/Date; At 0 455 Range 0 454 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 455 Range 0 454 Init 0 fixed
    // LocalVar   2 added: Name abyte0 Type [B At 11 443 Range 11 453 Init 11
    // LocalVar   5 added: Name s Type Ljava/lang/String; At 21 17 Range 21 37 Init 21
    // LocalVar   4 added: Name calendar Type Ljava/util/Calendar; At 31 393 Range 31 423 Init 31
    // LocalVar   6 added: Name flag Type Z At 65 173 Range 65 237 Init 65
    // LocalVar   3 added: Name i Type I At 118 209 Range 118 326 Init 118
    // LocalVar   7 added: Name s1 Type Ljava/lang/String; At 169 132 Range 169 300 Init 169
    // LocalVar   8 added: Name j Type I At 176 47 Range 176 222 Init 176
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 217 32 Range 217 248 Init 217
    // LocalVar  10 added: Name byte0 Type B At 228 15 Range 228 242 Init 228
    public static byte[] toBytes(Connection connection, Date date)
        throws SQLException
    {
        if(date == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        String s = ((OracleConnection)connection).getSessionTimeZone();
        Calendar calendar;
        if(s == null)
        {
            calendar = Calendar.getInstance();
        } else
        {
            calendar = Calendar.getInstance(TimeZone.getTimeZone(s));
        }
        calendar.setTime(date);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(date))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        calendar.set(11, 0);
        calendar.set(12, 0);
        calendar.set(13, 0);
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s1 = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s1);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s1));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s1));
        }
        calendar.add(10, -(i / HOUR_MILLISECOND));
        calendar.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar.get(2) + 1);
        abyte0[3] = (byte)calendar.get(5);
        abyte0[4] = (byte)(calendar.get(11) + 1);
        abyte0[5] = (byte)(calendar.get(12) + 1);
        abyte0[6] = (byte)(calendar.get(13) + 1);
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Date;Ljava/util/Calendar;)[B
    // Max stack: 4, #locals: 11, #params: 3
    // Code length: 440 bytes, Code offset: 6675
    // Line Number Table found: 50 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 440 Range 0 439 Init 0
    // Parameter  1 added: Name date Type Ljava/sql/Date; At 0 440 Range 0 439 Init 0
    // Parameter  2 added: Name calendar Type Ljava/util/Calendar; At 0 440 Range 0 439 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 440 Range 0 439 Init 0 fixed
    // LocalVar   4 added: Name abyte0 Type [B At 11 428 Range 11 438 Init 11
    // LocalVar   6 added: Name calendar1 Type Ljava/util/Calendar; At 16 388 Range 16 403 Init 16
    // LocalVar   5 added: Name flag Type Z At 36 172 Range 36 207 Init 36
    // LocalVar   3 added: Name i Type I At 87 213 Range 87 299 Init 87
    // LocalVar   7 added: Name s Type Ljava/lang/String; At 139 135 Range 139 273 Init 139
    // LocalVar   8 added: Name j Type I At 146 47 Range 146 192 Init 146
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 187 32 Range 187 218 Init 187
    // LocalVar  10 added: Name byte0 Type B At 198 15 Range 198 212 Init 198
    public static byte[] toBytes(Connection connection, Date date, Calendar calendar)
        throws SQLException
    {
        if(date == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        Calendar calendar1 = Calendar.getInstance();
        calendar1.setTime(date);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(date))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        calendar1.set(11, 0);
        calendar1.set(12, 0);
        calendar1.set(13, 0);
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar1, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s));
        }
        calendar1.add(10, -(i / HOUR_MILLISECOND));
        calendar1.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar1.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar1.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar1.get(2) + 1);
        abyte0[3] = (byte)calendar1.get(5);
        abyte0[4] = (byte)(calendar1.get(11) + 1);
        abyte0[5] = (byte)(calendar1.get(12) + 1);
        abyte0[6] = (byte)(calendar1.get(13) + 1);
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Time;)[B
    // Max stack: 5, #locals: 11, #params: 2
    // Code length: 439 bytes, Code offset: 7359
    // Line Number Table found: 49 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 439 Range 0 438 Init 0
    // Parameter  1 added: Name time Type Ljava/sql/Time; At 0 439 Range 0 438 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 439 Range 0 438 Init 0 fixed
    // LocalVar   5 added: Name abyte0 Type [B At 11 427 Range 11 437 Init 11
    // LocalVar   6 added: Name s Type Ljava/lang/String; At 22 16 Range 22 37 Init 22
    // LocalVar   2 added: Name calendar Type Ljava/util/Calendar; At 32 371 Range 32 402 Init 32
    // LocalVar   3 added: Name flag Type Z At 62 1 Range 62 62 Init 62
    // LocalVar   3 added: Name flag1 Type Z At 67 1 Range 67 67 Init 67
    // LocalVar   4 added: Name i Type I At 126 180 Range 126 305 Init 126
    // LocalVar   7 added: Name s1 Type Ljava/lang/String; At 181 99 Range 181 279 Init 181
    // LocalVar   8 added: Name j Type I At 188 46 Range 188 233 Init 188
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 229 14 Range 229 242 Init 229
    // LocalVar  10 added: Name byte0 Type B At 239 2 Range 239 240 Init 239
    // LocalVar   3 name flag1(Z) merged out into flag(Z)
    public static byte[] toBytes(Connection connection, Time time)
        throws SQLException
    {
        if(time == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        String s = ((OracleConnection)connection).getSessionTimeZone();
        Calendar calendar;
        if(s == null)
        {
            calendar = Calendar.getInstance();
        } else
        {
            calendar = Calendar.getInstance(TimeZone.getTimeZone(s));
        }
        calendar.setTime(time);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(time))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        calendar.set(1, (CENTURY_DEFAULT - 100) * 100 + DECADE_DEFAULT % 100);
        calendar.set(2, MONTH_DEFAULT - 1);
        calendar.set(5, DAY_DEFAULT);
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s1 = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s1);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar, j, offsetdst);
            i = offsetdst.getOFFSET();
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s1));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s1));
        }
        calendar.add(10, -(i / HOUR_MILLISECOND));
        calendar.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar.get(2) + 1);
        abyte0[3] = (byte)calendar.get(5);
        abyte0[4] = (byte)(calendar.get(11) + 1);
        abyte0[5] = (byte)(calendar.get(12) + 1);
        abyte0[6] = (byte)(calendar.get(13) + 1);
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Time;Ljava/util/Calendar;)[B
    // Max stack: 5, #locals: 11, #params: 3
    // Code length: 451 bytes, Code offset: 8038
    // Line Number Table found: 50 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 451 Range 0 450 Init 0
    // Parameter  1 added: Name time Type Ljava/sql/Time; At 0 451 Range 0 450 Init 0
    // Parameter  2 added: Name calendar Type Ljava/util/Calendar; At 0 451 Range 0 450 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 451 Range 0 450 Init 0 fixed
    // LocalVar   3 added: Name calendar1 Type Ljava/util/Calendar; At 9 406 Range 9 414 Init 9
    // LocalVar   6 added: Name abyte0 Type [B At 15 435 Range 15 449 Init 15
    // LocalVar   5 added: Name flag Type Z At 34 190 Range 34 223 Init 34
    // LocalVar   4 added: Name i Type I At 100 218 Range 100 317 Init 100
    // LocalVar   7 added: Name s Type Ljava/lang/String; At 155 137 Range 155 291 Init 155
    // LocalVar   8 added: Name j Type I At 162 46 Range 162 207 Init 162
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 203 32 Range 203 234 Init 203
    // LocalVar  10 added: Name byte0 Type B At 213 16 Range 213 228 Init 213
    public static byte[] toBytes(Connection connection, Time time, Calendar calendar)
        throws SQLException
    {
        if(time == null)
        {
            return null;
        }
        Calendar calendar1 = Calendar.getInstance();
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        calendar1.setTime(time);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(time))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        calendar1.set(1, (CENTURY_DEFAULT - 100) * 100 + DECADE_DEFAULT % 100);
        calendar1.set(2, MONTH_DEFAULT - 1);
        calendar1.set(5, DAY_DEFAULT);
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar1, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s));
        }
        calendar1.add(11, -(i / HOUR_MILLISECOND));
        calendar1.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar1.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar1.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar1.get(2) + 1);
        abyte0[3] = (byte)calendar1.get(5);
        abyte0[4] = (byte)(calendar1.get(11) + 1);
        abyte0[5] = (byte)(calendar1.get(12) + 1);
        abyte0[6] = (byte)(calendar1.get(13) + 1);
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Timestamp;)[B
    // Max stack: 4, #locals: 11, #params: 2
    // Code length: 468 bytes, Code offset: 8733
    // Line Number Table found: 51 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 468 Range 0 467 Init 0
    // Parameter  1 added: Name timestamp Type Ljava/sql/Timestamp; At 0 468 Range 0 467 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 468 Range 0 467 Init 0 fixed
    // LocalVar   2 added: Name abyte0 Type [B At 11 456 Range 11 466 Init 11
    // LocalVar   6 added: Name s Type Ljava/lang/String; At 21 17 Range 21 37 Init 21
    // LocalVar   5 added: Name calendar Type Ljava/util/Calendar; At 31 369 Range 31 399 Init 31
    // LocalVar   4 added: Name flag Type Z At 65 149 Range 65 213 Init 65
    // LocalVar   3 added: Name i Type I At 94 209 Range 94 302 Init 94
    // LocalVar   7 added: Name s1 Type Ljava/lang/String; At 145 132 Range 145 276 Init 145
    // LocalVar   8 added: Name j Type I At 152 47 Range 152 198 Init 152
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 193 32 Range 193 224 Init 193
    // LocalVar  10 added: Name byte0 Type B At 204 15 Range 204 218 Init 204
    public static byte[] toBytes(Connection connection, Timestamp timestamp)
        throws SQLException
    {
        if(timestamp == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        String s = ((OracleConnection)connection).getSessionTimeZone();
        Calendar calendar;
        if(s == null)
        {
            calendar = Calendar.getInstance();
        } else
        {
            calendar = Calendar.getInstance(TimeZone.getTimeZone(s));
        }
        calendar.setTime(timestamp);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(timestamp))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s1 = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s1);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s1));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s1));
        }
        calendar.add(10, -(i / HOUR_MILLISECOND));
        calendar.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar.get(2) + 1);
        abyte0[3] = (byte)calendar.get(5);
        abyte0[4] = (byte)(calendar.get(11) + 1);
        abyte0[5] = (byte)(calendar.get(12) + 1);
        abyte0[6] = (byte)(calendar.get(13) + 1);
        abyte0[7] = (byte)(timestamp.getNanos() >> 24);
        abyte0[8] = (byte)(timestamp.getNanos() >> 16 & 0xff);
        abyte0[9] = (byte)(timestamp.getNanos() >> 8 & 0xff);
        abyte0[10] = (byte)(timestamp.getNanos() & 0xff);
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Ljava/sql/Timestamp;Ljava/util/Calendar;)[B
    // Max stack: 4, #locals: 11, #params: 3
    // Code length: 442 bytes, Code offset: 9449
    // Line Number Table found: 47 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 442 Range 0 441 Init 0
    // Parameter  1 added: Name timestamp Type Ljava/sql/Timestamp; At 0 442 Range 0 441 Init 0
    // Parameter  2 added: Name calendar Type Ljava/util/Calendar; At 0 442 Range 0 441 Init 0
    // RetValue  11 added: Name <returnValue> Type [B At 0 442 Range 0 441 Init 0 fixed
    // LocalVar   3 added: Name abyte0 Type [B At 11 430 Range 11 440 Init 11
    // LocalVar   4 added: Name calendar1 Type Ljava/util/Calendar; At 15 359 Range 15 373 Init 15
    // LocalVar   6 added: Name flag Type Z At 35 149 Range 35 183 Init 35
    // LocalVar   5 added: Name i Type I At 62 215 Range 62 276 Init 62
    // LocalVar   7 added: Name s Type Ljava/lang/String; At 115 134 Range 115 248 Init 115
    // LocalVar   8 added: Name j Type I At 122 46 Range 122 167 Init 122
    // LocalVar   9 added: Name offsetdst Type Loracle/sql/OffsetDST; At 163 32 Range 163 194 Init 163
    // LocalVar  10 added: Name byte0 Type B At 173 16 Range 173 188 Init 173
    public static byte[] toBytes(Connection connection, Timestamp timestamp, Calendar calendar)
        throws SQLException
    {
        if(timestamp == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        Calendar calendar1 = Calendar.getInstance();
        calendar1.setTime(timestamp);
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(timestamp))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s));
        }
        calendar1.add(10, -(i / HOUR_MILLISECOND));
        calendar1.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar1.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar1.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar1.get(2) + 1);
        abyte0[3] = (byte)calendar1.get(5);
        abyte0[4] = (byte)(calendar1.get(11) + 1);
        abyte0[5] = (byte)(calendar1.get(12) + 1);
        abyte0[6] = (byte)(calendar1.get(13) + 1);
        abyte0[7] = (byte)(timestamp.getNanos() >> 24);
        abyte0[8] = (byte)(timestamp.getNanos() >> 16 & 0xff);
        abyte0[9] = (byte)(timestamp.getNanos() >> 8 & 0xff);
        abyte0[10] = (byte)(timestamp.getNanos() & 0xff);
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: (Ljava/sql/Connection;Loracle/sql/DATE;)[B
    // Max stack: 4, #locals: 10, #params: 2
    // Code length: 414 bytes, Code offset: 10123
    // Line Number Table found: 47 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 414 Range 0 413 Init 0
    // Parameter  1 added: Name date Type Loracle/sql/DATE; At 0 414 Range 0 413 Init 0
    // RetValue  10 added: Name <returnValue> Type [B At 0 414 Range 0 413 Init 0 fixed
    // LocalVar   3 added: Name abyte0 Type [B At 11 402 Range 11 412 Init 11
    // LocalVar   5 added: Name calendar Type Ljava/util/Calendar; At 15 368 Range 15 382 Init 15
    // LocalVar   4 added: Name flag Type Z At 48 149 Range 48 196 Init 48
    // LocalVar   2 added: Name i Type I At 77 209 Range 77 285 Init 77
    // LocalVar   6 added: Name s Type Ljava/lang/String; At 128 132 Range 128 259 Init 128
    // LocalVar   7 added: Name j Type I At 135 47 Range 135 181 Init 135
    // LocalVar   8 added: Name offsetdst Type Loracle/sql/OffsetDST; At 176 32 Range 176 207 Init 176
    // LocalVar   9 added: Name byte0 Type B At 187 15 Range 187 201 Init 187
    public static byte[] toBytes(Connection connection, DATE date)
        throws SQLException
    {
        if(date == null)
        {
            return null;
        }
        byte abyte0[] = new byte[SIZE_TIMESTAMPTZ];
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(DATE.toDate(date.toBytes()));
        boolean flag;
        if(calendar.getTimeZone().inDaylightTime(DATE.toDate(date.toBytes())))
        {
            flag = true;
        } else
        {
            flag = false;
        }
        int i;
        if(calendar.getTimeZone().getID() == "Custom")
        {
            i = calendar.getTimeZone().getRawOffset();
            abyte0[11] = (byte)(i / HOUR_MILLISECOND + OFFSET_HOUR);
            abyte0[12] = (byte)((i % HOUR_MILLISECOND) / MINUTE_MILLISECOND + OFFSET_MINUTE);
        } else
        {
            String s = new String(calendar.getTimeZone().getID());
            int j = ZONEIDMAP.getID(s);
            if(j == ZONEIDMAP.INV_ZONEID)
            {
                throw new SQLException("Timezone not supported");
            }
            if(TIMEZONETAB.checkID(j))
            {
                TIMEZONETAB.updateTable(connection, j);
            }
            OffsetDST offsetdst = new OffsetDST();
            byte byte0 = TIMEZONETAB.getLocalOffset(calendar, j, offsetdst);
            i = offsetdst.getOFFSET();
            if(flag && byte0 == 1)
            {
                if(offsetdst.getDSTFLAG() == 0)
                {
                    i += HOUR_MILLISECOND;
                } else
                {
                    throw new SQLException();
                }
            }
            abyte0[11] = (byte)setHighOrderbits(ZONEIDMAP.getID(s));
            abyte0[11] |= REGIONIDBIT;
            abyte0[12] = (byte)setLowOrderbits(ZONEIDMAP.getID(s));
        }
        calendar.add(10, -(i / HOUR_MILLISECOND));
        calendar.add(12, -(i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        abyte0[0] = (byte)(calendar.get(1) / 100 + 100);
        abyte0[1] = (byte)(calendar.get(1) % 100 + 100);
        abyte0[2] = (byte)(calendar.get(2) + 1);
        abyte0[3] = (byte)calendar.get(5);
        abyte0[4] = (byte)(calendar.get(11) + 1);
        abyte0[5] = (byte)(calendar.get(12) + 1);
        abyte0[6] = (byte)(calendar.get(13) + 1);
        abyte0[7] = 0;
        abyte0[8] = 0;
        abyte0[9] = 0;
        abyte0[10] = 0;
        return abyte0;
    }

    // Decompiling method: toDATE  Signature: (Ljava/sql/Connection;[B)Loracle/sql/DATE;
    // Max stack: 6, #locals: 9, #params: 2
    // Code length: 266 bytes, Code offset: 10769
    // Line Number Table found: 26 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 266 Range 0 265 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 266 Range 0 265 Init 0
    // RetValue   9 added: Name <returnValue> Type Loracle/sql/DATE; At 0 266 Range 0 265 Init 0 fixed
    // LocalVar   2 added: Name ai Type [I At 5 224 Range 5 228 Init 5
    // LocalVar   4 added: Name flag Type Z At 7 22 Range 7 28 Init 7
    // LocalVar   4 chged: Name i Oname flag Type I At 27 2 Range 7 28 Init 7
    // LocalVar   5 added: Name calendar Type Ljava/util/Calendar; At 38 203 Range 38 240 Init 38
    // LocalVar   6 added: Name j Type I At 49 7 Range 49 55 Init 49
    // LocalVar   7 added: Name k Type I At 142 4 Range 142 145 Init 142
    // LocalVar   7 added: Name l Type I At 154 20 Range 154 173 Init 154
    // LocalVar   3 added: Name i1 Type I At 177 18 Range 177 194 Init 177
    // LocalVar   7 added: Name l1 Type J At 247 12 Range 247 258 Init 247
    // LocalVar   7 name l(I) merged out into k(I)
    public static DATE toDATE(Connection connection, byte abyte0[])
        throws SQLException
    {
        int ai[] = new int[SIZE_TIMESTAMPTZ];
        for(int j = 0; j < SIZE_TIMESTAMPTZ; j++)
        {
            ai[j] = abyte0[j] & 0xff;
        }

        Calendar calendar = Calendar.getInstance();
        int k = getJavaYear(ai[0], ai[1]);
        calendar.set(1, k);
        calendar.set(2, ai[2] - 1);
        calendar.set(5, ai[3]);
        calendar.set(11, ai[4] - 1);
        calendar.set(12, ai[5] - 1);
        calendar.set(13, ai[6] - 1);
        calendar.set(14, 0);
        if((ai[11] & REGIONIDBIT) != 0)
        {
            int l = getHighOrderbits(ai[11]);
            l += getLowOrderbits(ai[12]);
            if(TIMEZONETAB.checkID(l))
            {
                TIMEZONETAB.updateTable(connection, l);
            }
            int i = TIMEZONETAB.getOffset(calendar, l);
            calendar.add(10, i / HOUR_MILLISECOND);
            calendar.add(12, (i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        } else
        {
            calendar.add(10, ai[11] - OFFSET_HOUR);
            calendar.add(12, ai[12] - OFFSET_MINUTE);
        }
        long l1 = calendar.getTime().getTime();
        return new DATE(new Date(l1));
    }

    // Decompiling method: toDate  Signature: (Ljava/sql/Connection;[B)Ljava/sql/Date;
    // Max stack: 4, #locals: 9, #params: 2
    // Code length: 259 bytes, Code offset: 11183
    // Line Number Table found: 26 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 259 Range 0 258 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 259 Range 0 258 Init 0
    // RetValue   9 added: Name <returnValue> Type Ljava/sql/Date; At 0 259 Range 0 258 Init 0 fixed
    // LocalVar   2 added: Name ai Type [I At 5 224 Range 5 228 Init 5
    // LocalVar   4 added: Name flag Type Z At 7 22 Range 7 28 Init 7
    // LocalVar   4 chged: Name i Oname flag Type I At 27 2 Range 7 28 Init 7
    // LocalVar   5 added: Name j Type I At 44 12 Range 44 55 Init 44
    // LocalVar   6 added: Name calendar Type Ljava/util/Calendar; At 49 192 Range 49 240 Init 49
    // LocalVar   7 added: Name k Type I At 142 4 Range 142 145 Init 142
    // LocalVar   7 added: Name l Type I At 154 20 Range 154 173 Init 154
    // LocalVar   3 added: Name i1 Type I At 177 18 Range 177 194 Init 177
    // LocalVar   7 added: Name l1 Type J At 247 8 Range 247 254 Init 247
    // LocalVar   7 name l(I) merged out into k(I)
    public static Date toDate(Connection connection, byte abyte0[])
        throws SQLException
    {
        int ai[] = new int[SIZE_TIMESTAMPTZ];
        for(int j = 0; j < SIZE_TIMESTAMPTZ; j++)
        {
            ai[j] = abyte0[j] & 0xff;
        }

        int k = getJavaYear(ai[0], ai[1]);
        Calendar calendar = Calendar.getInstance();
        calendar.set(1, k);
        calendar.set(2, ai[2] - 1);
        calendar.set(5, ai[3]);
        calendar.set(11, ai[4] - 1);
        calendar.set(12, ai[5] - 1);
        calendar.set(13, ai[6] - 1);
        calendar.set(14, 0);
        if((ai[11] & REGIONIDBIT) != 0)
        {
            int l = getHighOrderbits(ai[11]);
            l += getLowOrderbits(ai[12]);
            if(TIMEZONETAB.checkID(l))
            {
                TIMEZONETAB.updateTable(connection, l);
            }
            int i = TIMEZONETAB.getOffset(calendar, l);
            calendar.add(10, i / HOUR_MILLISECOND);
            calendar.add(12, (i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        } else
        {
            calendar.add(10, ai[11] - OFFSET_HOUR);
            calendar.add(12, ai[12] - OFFSET_MINUTE);
        }
        long l1 = calendar.getTime().getTime();
        return new Date(l1);
    }

    // Decompiling method: toJdbc  Signature: ()Ljava/lang/Object;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 2 bytes, Code offset: 11590
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/TIMESTAMPTZ; 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 null;
    }

    // Decompiling method: toString  Signature: (Ljava/sql/Connection;[B)Ljava/lang/String;
    // Max stack: 5, #locals: 14, #params: 2
    // Code length: 321 bytes, Code offset: 11640
    // Line Number Table found: 25 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 321 Range 0 320 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 321 Range 0 320 Init 0
    // RetValue  14 added: Name <returnValue> Type Ljava/lang/String; At 0 321 Range 0 320 Init 0 fixed
    // LocalVar   2 added: Name timestamp Type Ljava/sql/Timestamp; At 5 9 Range 5 13 Init 5
    // LocalVar   4 added: Name calendar Type Ljava/util/Calendar; At 9 54 Range 9 62 Init 9
    // LocalVar   5 added: Name i Type I At 23 219 Range 23 241 Init 23
    // LocalVar   6 added: Name j Type I At 33 222 Range 33 254 Init 33
    // LocalVar   7 added: Name k Type I At 41 224 Range 41 264 Init 41
    // LocalVar   8 added: Name l Type I At 50 225 Range 50 274 Init 50
    // LocalVar   9 added: Name i1 Type I At 59 226 Range 59 284 Init 59
    // LocalVar  10 added: Name j1 Type I At 68 227 Range 68 294 Init 68
    // LocalVar  11 added: Name flag Type Z At 71 2 Range 71 72 Init 71
    // LocalVar  11 added: Name k1 Type I At 84 4 Range 84 87 Init 84
    // LocalVar  11 added: Name l1 Type I At 100 4 Range 100 103 Init 100
    // LocalVar  11 added: Name i2 Type I At 116 4 Range 116 119 Init 116
    // LocalVar  11 added: Name j2 Type I At 133 172 Range 133 304 Init 133
    // LocalVar  12 added: Name k2 Type I At 153 4 Range 153 156 Init 153
    // LocalVar  12 added: Name l2 Type I At 165 8 Range 165 172 Init 165
    // LocalVar   3 added: Name s Type Ljava/lang/String; At 179 135 Range 179 313 Init 179
    // LocalVar  12 added: Name i3 Type I At 191 22 Range 191 212 Init 191
    // LocalVar  13 added: Name j3 Type I At 201 25 Range 201 225 Init 201
    // LocalVar  11 chged: Name k3 Oname flag Type I At 71 2 Range 71 72 Init 71
    // LocalVar  11 name k1(I) merged out into k3(I)
    // LocalVar  11 name l1(I) merged out into k3(I)
    // LocalVar  11 name i2(I) merged out into k3(I)
    // LocalVar  11 name j2(I) merged out into k3(I)
    // LocalVar  12 name l2(I) merged out into k2(I)
    public static String toString(Connection connection, byte abyte0[])
        throws SQLException
    {
        Timestamp timestamp = toTimestamp(connection, abyte0);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(timestamp);
        int i = calendar.get(1);
        int j = calendar.get(2) + 1;
        int k = calendar.get(5);
        int l = calendar.get(11);
        int i1 = calendar.get(12);
        int j1 = calendar.get(13);
        int k1 = 0;
        k1 = (abyte0[7] & 0xff) << 24;
        k1 |= (abyte0[8] & 0xff) << 16;
        k1 |= (abyte0[9] & 0xff) << 8;
        k1 |= abyte0[10] & 0xff & 0xff;
        String s;
        if((abyte0[11] & REGIONIDBIT) != 0)
        {
            int l1 = getHighOrderbits(abyte0[11]);
            l1 += getLowOrderbits(abyte0[12]);
            s = new String(ZONEIDMAP.getRegion(l1));
        } else
        {
            int i2 = abyte0[11] - OFFSET_HOUR;
            int j2 = abyte0[12] - OFFSET_MINUTE;
            s = new String(i2 + ":" + j2);
        }
        return i + "-" + j + "-" + k + " " + l + "." + i1 + "." + j1 + "." + k1 + " " + s;
    }

    // Decompiling method: toTime  Signature: (Ljava/sql/Connection;[B)Ljava/sql/Time;
    // Max stack: 4, #locals: 9, #params: 2
    // Code length: 259 bytes, Code offset: 12105
    // Line Number Table found: 26 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 259 Range 0 258 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 259 Range 0 258 Init 0
    // RetValue   9 added: Name <returnValue> Type Ljava/sql/Time; At 0 259 Range 0 258 Init 0 fixed
    // LocalVar   2 added: Name ai Type [I At 5 224 Range 5 228 Init 5
    // LocalVar   4 added: Name flag Type Z At 7 22 Range 7 28 Init 7
    // LocalVar   4 chged: Name i Oname flag Type I At 27 2 Range 7 28 Init 7
    // LocalVar   5 added: Name calendar Type Ljava/util/Calendar; At 38 203 Range 38 240 Init 38
    // LocalVar   6 added: Name j Type I At 49 7 Range 49 55 Init 49
    // LocalVar   7 added: Name k Type I At 142 4 Range 142 145 Init 142
    // LocalVar   7 added: Name l Type I At 154 20 Range 154 173 Init 154
    // LocalVar   3 added: Name i1 Type I At 177 18 Range 177 194 Init 177
    // LocalVar   7 added: Name l1 Type J At 247 8 Range 247 254 Init 247
    // LocalVar   7 name l(I) merged out into k(I)
    public static Time toTime(Connection connection, byte abyte0[])
        throws SQLException
    {
        int ai[] = new int[SIZE_TIMESTAMPTZ];
        for(int j = 0; j < SIZE_TIMESTAMPTZ; j++)
        {
            ai[j] = abyte0[j] & 0xff;
        }

        Calendar calendar = Calendar.getInstance();
        int k = getJavaYear(ai[0], ai[1]);
        calendar.set(1, k);
        calendar.set(2, ai[2] - 1);
        calendar.set(5, ai[3]);
        calendar.set(11, ai[4] - 1);
        calendar.set(12, ai[5] - 1);
        calendar.set(13, ai[6] - 1);
        calendar.set(14, 0);
        if((ai[11] & REGIONIDBIT) != 0)
        {
            int l = getHighOrderbits(ai[11]);
            l += getLowOrderbits(ai[12]);
            if(TIMEZONETAB.checkID(l))
            {
                TIMEZONETAB.updateTable(connection, l);
            }
            int i = TIMEZONETAB.getOffset(calendar, l);
            calendar.add(10, i / HOUR_MILLISECOND);
            calendar.add(12, (i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        } else
        {
            calendar.add(10, ai[11] - OFFSET_HOUR);
            calendar.add(12, ai[12] - OFFSET_MINUTE);
        }
        long l1 = calendar.getTime().getTime();
        return new Time(l1);
    }

    // Decompiling method: toTimestamp  Signature: (Ljava/sql/Connection;[B)Ljava/sql/Timestamp;
    // Max stack: 4, #locals: 11, #params: 2
    // Code length: 316 bytes, Code offset: 12512
    // Line Number Table found: 32 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 316 Range 0 315 Init 0
    // Parameter  1 added: Name abyte0 Type [B At 0 316 Range 0 315 Init 0
    // RetValue  11 added: Name <returnValue> Type Ljava/sql/Timestamp; At 0 316 Range 0 315 Init 0 fixed
    // LocalVar   2 added: Name ai Type [I At 5 291 Range 5 295 Init 5
    // LocalVar   4 added: Name flag Type Z At 7 22 Range 7 28 Init 7
    // LocalVar   4 chged: Name i Oname flag Type I At 27 2 Range 7 28 Init 7
    // LocalVar   5 added: Name calendar Type Ljava/util/Calendar; At 38 203 Range 38 240 Init 38
    // LocalVar   6 added: Name j Type I At 49 7 Range 49 55 Init 49
    // LocalVar   7 added: Name k Type I At 142 4 Range 142 145 Init 142
    // LocalVar   7 added: Name l Type I At 154 20 Range 154 173 Init 154
    // LocalVar   3 added: Name i1 Type I At 177 18 Range 177 194 Init 177
    // LocalVar   7 added: Name l1 Type J At 247 8 Range 247 254 Init 247
    // LocalVar   9 added: Name timestamp Type Ljava/sql/Timestamp; At 258 57 Range 258 314 Init 258
    // LocalVar  10 added: Name j1 Type I At 267 4 Range 267 270 Init 267
    // LocalVar  10 added: Name k1 Type I At 279 4 Range 279 282 Init 279
    // LocalVar  10 added: Name i2 Type I At 291 4 Range 291 294 Init 291
    // LocalVar  10 added: Name j2 Type I At 304 6 Range 304 309 Init 304
    // LocalVar   7 name l(I) merged out into k(I)
    // LocalVar  10 name k1(I) merged out into j1(I)
    // LocalVar  10 name i2(I) merged out into j1(I)
    // LocalVar  10 name j2(I) merged out into j1(I)
    public static Timestamp toTimestamp(Connection connection, byte abyte0[])
        throws SQLException
    {
        int ai[] = new int[SIZE_TIMESTAMPTZ];
        for(int j = 0; j < SIZE_TIMESTAMPTZ; j++)
        {
            ai[j] = abyte0[j] & 0xff;
        }

        Calendar calendar = Calendar.getInstance();
        int k = getJavaYear(ai[0], ai[1]);
        calendar.set(1, k);
        calendar.set(2, ai[2] - 1);
        calendar.set(5, ai[3]);
        calendar.set(11, ai[4] - 1);
        calendar.set(12, ai[5] - 1);
        calendar.set(13, ai[6] - 1);
        calendar.set(14, 0);
        if((ai[11] & REGIONIDBIT) != 0)
        {
            int l = getHighOrderbits(ai[11]);
            l += getLowOrderbits(ai[12]);
            if(TIMEZONETAB.checkID(l))
            {
                TIMEZONETAB.updateTable(connection, l);
            }
            int i = TIMEZONETAB.getOffset(calendar, l);
            calendar.add(10, i / HOUR_MILLISECOND);
            calendar.add(12, (i % HOUR_MILLISECOND) / MINUTE_MILLISECOND);
        } else
        {
            calendar.add(10, ai[11] - OFFSET_HOUR);
            calendar.add(12, ai[12] - OFFSET_MINUTE);
        }
        long l1 = calendar.getTime().getTime();
        Timestamp timestamp = new Timestamp(l1);
        int i1 = ai[7] << 24;
        i1 |= ai[8] << 16;
        i1 |= ai[9] << 8;
        i1 |= ai[10] & 0xff;
        timestamp.setNanos(i1);
        return timestamp;
    }

    // Decompiling method: <clinit>  Signature: ()V
    // Max stack: 1, #locals: 0, #params: 0
    // Code length: 74 bytes, Code offset: 4290
    // Line Number Table found: 16 entries
    // RetValue   0 added: Name <returnValue> Type V At 0 74 Range 0 73 Init 0 fixed
    static 
    {
        /* CENTURY_DEFAULT = 119; */
        /* DECADE_DEFAULT = 100; */
        /* MONTH_DEFAULT = 1; */
        /* DAY_DEFAULT = 1; */
        /* DECADE_INIT = 170; */
        /* HOUR_MILLISECOND = 0x36ee80; */
        /* MINUTE_MILLISECOND = 60000; */
        /* JAVA_YEAR = 1970; */
        /* JAVA_MONTH = 0; */
        /* JAVA_DATE = 1; */
        /* SIZE_TIMESTAMPTZ = 13; */
        /* SIZE_TIMESTAMP = 11; */
        /* OFFSET_HOUR = 20; */
        /* OFFSET_MINUTE = 60; */
        /* REGIONIDBIT = -128; */
    }
}
