sdbc_hsqldb

16:52:14.930 INFO  jd.cli.Main - Decompiling sdbc_hsqldb.jar
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;
import java.io.InputStream;

public class NativeInputStreamHelper
  extends InputStream
{
  private String key;
  private String file;
  private StorageNativeInputStream in;
  
  public NativeInputStreamHelper(String paramString1, String paramString2)
  {
    file = paramString2;
    key = paramString1;
    in = new StorageNativeInputStream(paramString1, file);
  }
  
  public int read()
    throws IOException
  {
    return in.read(key, file);
  }
  
  public int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    return in.read(key, file, paramArrayOfByte, paramInt1, paramInt2);
  }
  
  public void close()
    throws IOException
  {
    in.close(key, file);
  }
  
  public long skip(long paramLong)
    throws IOException
  {
    return in.skip(key, file, paramLong);
  }
  
  public int available()
    throws IOException
  {
    return in.available(key, file);
  }
  
  public int read(byte[] paramArrayOfByte)
    throws IOException
  {
    return in.read(key, file, paramArrayOfByte);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.NativeInputStreamHelper
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;

final class NativeLibraries
{
  public static void load()
  {
    if (System.getProperty("os.name").startsWith("Windows"))
    {
      loadLibrary("msvcr71");
      loadLibrary("uwinapi");
      loadLibrary("sal3");
      loadLibrary("dbtoolsmi");
    }
    loadLibrary("hsqldb");
  }
  
  private static void loadLibrary(String paramString)
  {
    try
    {
      System.loadLibrary(paramString);
    }
    catch (UnsatisfiedLinkError localUnsatisfiedLinkError)
    {
      ClassLoader localClassLoader = NativeLibraries.class.getClassLoader();
      if ((localClassLoader instanceof URLClassLoader))
      {
        URL localURL = ((URLClassLoader)localClassLoader).findResource(System.mapLibraryName(paramString));
        if (localURL != null) {
          try
          {
            System.load(((File)File.class.getConstructor(new Class[] { ClassLoader.getSystemClassLoader().loadClass("java.net.URI") }).newInstance(new Object[] { URL.class.getMethod("toURI", new Class[0]).invoke(localURL, (Object[])null) })).getAbsolutePath());
          }
          catch (Throwable localThrowable)
          {
            throw new UnsatisfiedLinkError(localUnsatisfiedLinkError.toString() + " - " + localThrowable.toString());
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.NativeLibraries
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;
import java.io.OutputStream;

public class NativeOutputStreamHelper
  extends OutputStream
{
  private String key;
  private String file;
  private StorageNativeOutputStream out;
  
  public NativeOutputStreamHelper(String paramString1, String paramString2)
  {
    file = paramString2;
    key = paramString1;
    out = new StorageNativeOutputStream(file, paramString1);
  }
  
  public void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    out.write(key, file, paramArrayOfByte, paramInt1, paramInt2);
  }
  
  public void write(byte[] paramArrayOfByte)
    throws IOException
  {
    out.write(key, file, paramArrayOfByte);
  }
  
  public void close()
    throws IOException
  {
    out.close(key, file);
  }
  
  public void write(int paramInt)
    throws IOException
  {
    out.write(key, file, paramInt);
  }
  
  public void flush()
    throws IOException
  {
    out.flush(key, file);
  }
  
  public void sync()
    throws IOException
  {
    out.sync(key, file);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.NativeOutputStreamHelper
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;

public class NativeStorageAccess
{
  public static final int READ = 1;
  public static final int SEEKABLE = 2;
  public static final int SEEKABLEREAD = 3;
  public static final int WRITE = 4;
  public static final int READWRITE = 7;
  public static final int TRUNCATE = 8;
  
  public NativeStorageAccess(String paramString1, String paramString2, Object paramObject)
    throws IOException
  {
    try
    {
      int i = 3;
      if (paramString2.equals("rw")) {
        i = 7;
      }
      openStream(paramString1, (String)paramObject, i);
    }
    catch (Exception localException)
    {
      throw new IOException();
    }
  }
  
  public native void openStream(String paramString1, String paramString2, int paramInt);
  
  public native void close(String paramString1, String paramString2)
    throws IOException;
  
  public native long getFilePointer(String paramString1, String paramString2)
    throws IOException;
  
  public native long length(String paramString1, String paramString2)
    throws IOException;
  
  public native int read(String paramString1, String paramString2)
    throws IOException;
  
  public native int read(String paramString1, String paramString2, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException;
  
  public native int readInt(String paramString1, String paramString2)
    throws IOException;
  
  public native void seek(String paramString1, String paramString2, long paramLong)
    throws IOException;
  
  public native void write(String paramString1, String paramString2, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException;
  
  public native void writeInt(String paramString1, String paramString2, int paramInt)
    throws IOException;
  
  static {}
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.NativeStorageAccess
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;
import org.hsqldb.lib.Storage;

public class StorageAccess
  implements Storage
{
  String key;
  String name;
  boolean readonly;
  NativeStorageAccess access;
  
  public StorageAccess(String paramString, Boolean paramBoolean, Object paramObject)
    throws IOException
  {
    key = ((String)paramObject);
    name = paramString;
    readonly = paramBoolean.booleanValue();
    try
    {
      access = new NativeStorageAccess(paramString, readonly ? "r" : "rw", paramObject);
    }
    catch (Exception localException)
    {
      throw new IOException();
    }
  }
  
  public void close()
    throws IOException
  {
    access.close(name, key);
  }
  
  public long getFilePointer()
    throws IOException
  {
    return access.getFilePointer(name, key);
  }
  
  public long length()
    throws IOException
  {
    return access.length(name, key);
  }
  
  public int read()
    throws IOException
  {
    return access.read(name, key);
  }
  
  public void read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    access.read(name, key, paramArrayOfByte, paramInt1, paramInt2);
  }
  
  public int readInt()
    throws IOException
  {
    byte[] arrayOfByte = new byte[4];
    
    int i = access.read(name, key, arrayOfByte, 0, 4);
    if (i != 4) {
      throw new IOException();
    }
    i = 0;
    int j = arrayOfByte[(i++)] & 0xFF;
    int k = arrayOfByte[(i++)] & 0xFF;
    int m = arrayOfByte[(i++)] & 0xFF;
    int n = arrayOfByte[i] & 0xFF;
    
    return (j << 24) + (k << 16) + (m << 8) + n;
  }
  
  public void seek(long paramLong)
    throws IOException
  {
    access.seek(name, key, paramLong);
  }
  
  public void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    access.write(name, key, paramArrayOfByte, paramInt1, paramInt2);
  }
  
  public void writeInt(int paramInt)
    throws IOException
  {
    byte[] arrayOfByte = new byte[4];
    arrayOfByte[0] = ((byte)(paramInt >>> 24 & 0xFF));
    arrayOfByte[1] = ((byte)(paramInt >>> 16 & 0xFF));
    arrayOfByte[2] = ((byte)(paramInt >>> 8 & 0xFF));
    arrayOfByte[3] = ((byte)(paramInt >>> 0 & 0xFF));
    
    write(arrayOfByte, 0, 4);
  }
  
  public boolean isReadOnly()
  {
    return readonly;
  }
  
  public long readLong()
    throws IOException
  {
    return (readInt() << 32) + (readInt() & 0xFFFFFFFF);
  }
  
  public boolean wasNio()
  {
    return false;
  }
  
  public void writeLong(long paramLong)
    throws IOException
  {
    byte[] arrayOfByte = new byte[8];
    
    arrayOfByte[0] = ((byte)(int)(paramLong >>> 56 & 0xFF));
    arrayOfByte[1] = ((byte)(int)(paramLong >>> 48 & 0xFF));
    arrayOfByte[2] = ((byte)(int)(paramLong >>> 40 & 0xFF));
    arrayOfByte[3] = ((byte)(int)(paramLong >>> 32 & 0xFF));
    arrayOfByte[4] = ((byte)(int)(paramLong >>> 24 & 0xFF));
    arrayOfByte[5] = ((byte)(int)(paramLong >>> 16 & 0xFF));
    arrayOfByte[6] = ((byte)(int)(paramLong >>> 8 & 0xFF));
    arrayOfByte[7] = ((byte)(int)(paramLong >>> 0 & 0xFF));
    
    write(arrayOfByte, 0, 8);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.StorageAccess
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;
import org.hsqldb.lib.FileAccess.FileSync;

public class StorageFileAccess$FileSync
  implements FileAccess.FileSync
{
  NativeOutputStreamHelper os;
  
  StorageFileAccess$FileSync(StorageFileAccess paramStorageFileAccess, NativeOutputStreamHelper paramNativeOutputStreamHelper)
    throws IOException
  {
    os = paramNativeOutputStreamHelper;
  }
  
  public void sync()
    throws IOException
  {
    os.sync();
  }
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess.FileSync
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.NoSuchElementException;
import org.hsqldb.lib.FileAccess;
import org.hsqldb.lib.FileAccess.FileSync;
import org.hsqldb.lib.FileSystemRuntimeException;

public class StorageFileAccess
  implements FileAccess
{
  String ds_name;
  String key;
  
  public StorageFileAccess(Object paramObject)
    throws Exception
  {
    key = ((String)paramObject);
  }
  
  public void createParentDirs(String paramString) {}
  
  public boolean isStreamElement(String paramString)
  {
    return isStreamElement(key, paramString);
  }
  
  public InputStream openInputStreamElement(String paramString)
    throws IOException
  {
    return new NativeInputStreamHelper(key, paramString);
  }
  
  public OutputStream openOutputStreamElement(String paramString)
    throws IOException
  {
    return new NativeOutputStreamHelper(key, paramString);
  }
  
  public void removeElement(String paramString)
    throws NoSuchElementException
  {
    try
    {
      if (isStreamElement(key, paramString)) {
        removeElement(key, paramString);
      }
    }
    catch (IOException localIOException)
    {
      throw new FileSystemRuntimeException(localIOException, 1);
    }
  }
  
  public void renameElement(String paramString1, String paramString2)
    throws NoSuchElementException
  {
    try
    {
      if (isStreamElement(key, paramString1))
      {
        removeElement(key, paramString2);
        renameElement(key, paramString1, paramString2);
      }
    }
    catch (IOException localIOException)
    {
      throw new FileSystemRuntimeException(localIOException, 2);
    }
  }
  
  public class FileSync
    implements FileAccess.FileSync
  {
    NativeOutputStreamHelper os;
    
    FileSync(NativeOutputStreamHelper paramNativeOutputStreamHelper)
      throws IOException
    {
      os = paramNativeOutputStreamHelper;
    }
    
    public void sync()
      throws IOException
    {
      os.sync();
    }
  }
  
  public FileAccess.FileSync getFileSync(OutputStream paramOutputStream)
    throws IOException
  {
    return new FileSync((NativeOutputStreamHelper)paramOutputStream);
  }
  
  static native boolean isStreamElement(String paramString1, String paramString2);
  
  static native void removeElement(String paramString1, String paramString2)
    throws NoSuchElementException, IOException;
  
  static native void renameElement(String paramString1, String paramString2, String paramString3)
    throws NoSuchElementException, IOException;
  
  static {}
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;

public class StorageNativeInputStream
{
  public StorageNativeInputStream(String paramString1, String paramString2)
  {
    openStream(paramString1, paramString2, 1);
  }
  
  public native void openStream(String paramString1, String paramString2, int paramInt);
  
  public native int read(String paramString1, String paramString2)
    throws IOException;
  
  public native int read(String paramString1, String paramString2, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException;
  
  public native void close(String paramString1, String paramString2)
    throws IOException;
  
  public native long skip(String paramString1, String paramString2, long paramLong)
    throws IOException;
  
  public native int available(String paramString1, String paramString2)
    throws IOException;
  
  public native int read(String paramString1, String paramString2, byte[] paramArrayOfByte)
    throws IOException;
  
  static {}
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.StorageNativeInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.sdbcx.comp.hsqldb;

import java.io.IOException;

public class StorageNativeOutputStream
{
  String name;
  Object key;
  
  public StorageNativeOutputStream(String paramString, Object paramObject)
  {
    name = paramString;
    key = paramObject;
    openStream(name, (String)key, 12);
  }
  
  public native void openStream(String paramString1, String paramString2, int paramInt);
  
  public native void write(String paramString1, String paramString2, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException;
  
  public native void write(String paramString1, String paramString2, byte[] paramArrayOfByte)
    throws IOException;
  
  public native void close(String paramString1, String paramString2)
    throws IOException;
  
  public native void write(String paramString1, String paramString2, int paramInt)
    throws IOException;
  
  public native void flush(String paramString1, String paramString2)
    throws IOException;
  
  public native void sync(String paramString1, String paramString2)
    throws IOException;
  
  static {}
}

/* Location:
 * Qualified Name:     com.sun.star.sdbcx.comp.hsqldb.StorageNativeOutputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.hsqldb.lib;

public class FileSystemRuntimeException
  extends RuntimeException
{
  public static final int fileAccessRemoveElementFailed = 1;
  public static final int fileAccessRenameElementFailed = 2;
  private final int errorCode;
  
  public FileSystemRuntimeException(int paramInt)
  {
    errorCode = paramInt;
  }
  
  public FileSystemRuntimeException(String paramString, int paramInt)
  {
    super(paramString);
    errorCode = paramInt;
  }
  
  public FileSystemRuntimeException(String paramString, Throwable paramThrowable, int paramInt)
  {
    super(paramString, paramThrowable);
    errorCode = paramInt;
  }
  
  public FileSystemRuntimeException(Throwable paramThrowable, int paramInt)
  {
    super(paramThrowable);
    errorCode = paramInt;
  }
  
  public final int getErrorCode()
  {
    return errorCode;
  }
}

/* Location:
 * Qualified Name:     org.hsqldb.lib.FileSystemRuntimeException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd