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

package oracle.sql;

import java.io.*;
import java.sql.SQLException;
import oracle.jdbc.dbaccess.DBConversion;
import oracle.jdbc.dbaccess.DBError;
import oracle.jdbc.util.RepConversion;

// Referenced classes of package oracle.sql:
//            Datum

// flag ACC_SUPER is set
public class RAW extends Datum
{
    // Constants:          109
    // Interfaces:         0
    // Fields:             0
    // Methods:            10
    // Class Attributes:   1


    // Decompiling method: <init>  Signature: ()V
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 5 bytes, Code offset: 1254
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; 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 RAW()
    {
        super();
        return;
    }

    // Decompiling method: <init>  Signature: (Ljava/lang/Object;)V
    // Max stack: 5, #locals: 4, #params: 2
    // Code length: 69 bytes, Code offset: 1297
    // Line Number Table found: 12 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; At 0 69 Range 0 68 Init 0 fixed
    // Parameter  1 added: Name obj Type Ljava/lang/Object; At 0 69 Range 0 68 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 69 Range 0 68 Init 0 fixed
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 33 11 Range 33 43 Init 33
    // LocalVar   3 added: Name abyte0 Type [B At 40 16 Range 40 55 Init 40
    public RAW(Object obj)
        throws SQLException
    {
        this();
        if(obj instanceof byte[])
        {
            setShareBytes((byte[])obj);
        } else
        if(obj instanceof String)
        {
            String s = (String)obj;
            byte abyte0[] = new byte[s.length()];
            s.getBytes(0, s.length() - 1, abyte0, 0);
            setShareBytes(abyte0);
        } else
        {
            DBError.check_error(59, obj);
        }
        return;
    }

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

    // Decompiling method: asciiStreamValue  Signature: ()Ljava/io/InputStream;
    // Max stack: 3, #locals: 5, #params: 1
    // Code length: 51 bytes, Code offset: 1506
    // Line Number Table found: 7 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; At 0 51 Range 0 50 Init 0 fixed
    // RetValue   5 added: Name <returnValue> Type Ljava/io/InputStream; At 0 51 Range 0 50 Init 0 fixed
    // LocalVar   1 added: Name i Type I At 5 28 Range 5 32 Init 5
    // LocalVar   2 added: Name ac Type [C At 11 21 Range 11 31 Init 11
    // LocalVar   3 added: Name abyte0 Type [B At 16 2 Range 16 17 Init 16
    // LocalVar   4 added: Name abyte1 Type [B At 29 18 Range 29 46 Init 29
    public InputStream asciiStreamValue()
        throws SQLException
    {
        int i = (int)getLength();
        char ac[] = new char[i * 2];
        byte abyte0[] = shareBytes();
        DBConversion.RAWBytesToHexChars(abyte0, i, ac);
        byte abyte1[] = new byte[i * 2];
        DBConversion.javaCharsToAsciiBytes(ac, i * 2, abyte1);
        return new ByteArrayInputStream(abyte1);
    }

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

    // Decompiling method: characterStreamValue  Signature: ()Ljava/io/Reader;
    // Max stack: 3, #locals: 4, #params: 1
    // Code length: 33 bytes, Code offset: 1682
    // Line Number Table found: 5 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; At 0 33 Range 0 32 Init 0 fixed
    // RetValue   4 added: Name <returnValue> Type Ljava/io/Reader; At 0 33 Range 0 32 Init 0 fixed
    // LocalVar   1 added: Name i Type I At 5 14 Range 5 18 Init 5
    // LocalVar   2 added: Name ac Type [C At 11 18 Range 11 28 Init 11
    // LocalVar   3 added: Name abyte0 Type [B At 16 2 Range 16 17 Init 16
    public Reader characterStreamValue()
        throws SQLException
    {
        int i = (int)getLength();
        char ac[] = new char[i * 2];
        byte abyte0[] = shareBytes();
        DBConversion.RAWBytesToHexChars(abyte0, i, ac);
        return new CharArrayReader(ac);
    }

    // Decompiling method: isConvertibleTo  Signature: (Ljava/lang/Class;)Z
    // Max stack: 2, #locals: 3, #params: 2
    // Code length: 36 bytes, Code offset: 1779
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; At 0 36 Range 0 35 Init 0 fixed
    // Parameter  1 added: Name class1 Type Ljava/lang/Class; At 0 36 Range 0 35 Init 0
    // RetValue   3 added: Name <returnValue> Type Z At 0 36 Range 0 35 Init 0 fixed
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 4 20 Range 4 23 Init 4
    public boolean isConvertibleTo(Class class1)
    {
        String s = class1.getName();
        return s.compareTo("java.lang.String") == 0 || s.compareTo("java.io.InputStream") == 0 || s.compareTo("java.io.Reader") == 0;
    }

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

    // Decompiling method: stringValue  Signature: ()Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 1917
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/RAW; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/String; At 0 8 Range 0 7 Init 0 fixed
    public String stringValue()
    {
        return RepConversion.bArray2String(getBytes());
    }

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