summaryrefslogtreecommitdiff
path: root/connectivity/com
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-02-16 14:48:43 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-02-16 14:48:43 +0000
commit00289ccd349f57d5bebb3baaa8ceec7db4a12193 (patch)
treee929eccb12389df7f886ce3d6aac8be7e549c339 /connectivity/com
parentfcd304b9f442b818f7a6c885d4767dc60a90c0d6 (diff)
INTEGRATION: CWS hsqldb2 (1.3.2); FILE MERGED
2005/01/28 12:21:06 oj 1.3.2.2: #i39922# new interfaces in hsqldb 2005/01/26 09:05:07 oj 1.3.2.1: new version of hsqldb
Diffstat (limited to 'connectivity/com')
-rw-r--r--connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java43
1 files changed, 35 insertions, 8 deletions
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java b/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
index e16a89e69e55..434338f164f8 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
@@ -13,7 +13,8 @@ import com.sun.star.embed.ElementModes;
* @author oj93728
*/
public class StorageNativeOutputStream {
-
+ String name;
+ Object key;
static {
// preload shared libraries whichs import lips are linked to jpipe
if ( System.getProperty( "os.name" ).startsWith( "Windows" ) )
@@ -28,8 +29,10 @@ public class StorageNativeOutputStream {
NativeLibraryLoader.loadLibrary(StorageNativeOutputStream.class.getClassLoader(), "hsqldb2");
}
/** Creates a new instance of StorageNativeOutputStream */
- public StorageNativeOutputStream(String name,Object key) {
- openStream(name, (String)key, ElementModes.WRITE);
+ public StorageNativeOutputStream(String _name,Object _key) {
+ name = _name;
+ key = _key;
+ openStream(name, (String)key, ElementModes.WRITE | ElementModes.TRUNCATE);
}
public native void openStream(String name,String key, int mode);
@@ -62,7 +65,7 @@ public class StorageNativeOutputStream {
* an <code>IOException</code> is thrown if the output
* stream is closed.
*/
- public native void write(XStorage storage,String key,String _file,byte[] b, int off, int len) throws java.io.IOException;
+ public native void write(String key,String _file,byte[] b, int off, int len) throws java.io.IOException;
/**
* Writes <code>b.length</code> bytes from the specified byte array
@@ -74,7 +77,7 @@ public class StorageNativeOutputStream {
* @exception IOException if an I/O error occurs.
* @see java.io.OutputStream#write(byte[], int, int)
*/
- public native void write(XStorage storage,String key,String _file,byte[] b) throws java.io.IOException;
+ public native void write(String key,String _file,byte[] b) throws java.io.IOException;
/**
* Closes this output stream and releases any system resources
@@ -88,7 +91,7 @@ public class StorageNativeOutputStream {
*
* @exception IOException if an I/O error occurs.
*/
- public native void close(XStorage storage,String key,String _file) throws java.io.IOException;
+ public native void close(String key,String _file) throws java.io.IOException;
/**
* Writes the specified byte to this output stream. The general
@@ -107,7 +110,7 @@ public class StorageNativeOutputStream {
* an <code>IOException</code> may be thrown if the
* output stream has been closed.
*/
- public native void write(XStorage storage,String key,String _file,int b) throws java.io.IOException;
+ public native void write(String key,String _file,int b) throws java.io.IOException;
/**
* Flushes this output stream and forces any buffered output bytes
@@ -123,6 +126,30 @@ public class StorageNativeOutputStream {
*
* @exception IOException if an I/O error occurs.
*/
- public native void flush(XStorage storage,String key,String _file) throws java.io.IOException;
+ public native void flush(String key,String _file) throws java.io.IOException;
+
+ /**
+ * Force all system buffers to synchronize with the underlying
+ * device. This method returns after all modified data and
+ * attributes have been written to the relevant device(s).
+ *
+ * sync is meant to be used by code that requires physical
+ * storage (such as a file) to be in a known state For
+ * example, a class that provided a simple transaction facility
+ * might use sync to ensure that all changes to a file caused
+ * by a given transaction were recorded on a storage medium.
+ *
+ * sync only affects buffers downstream. If
+ * any in-memory buffering is being done by the application (for
+ * example, by a BufferedOutputStream object), those buffers must
+ * be flushed (for example, by invoking
+ * OutputStream.flush) before that data will be affected by sync.
+ *
+ * @exception IOException
+ * Thrown when the buffers cannot be flushed,
+ * or because the system cannot guarantee that all the
+ * buffers have been synchronized with physical media.
+ */
+ public native void sync(String key,String _file) throws java.io.IOException;
}