1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove
25*b1cdbd2cSJim Jagielski #include "precompiled_connectivity.hxx"
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
28*b1cdbd2cSJim Jagielski #include <config.h>
29*b1cdbd2cSJim Jagielski #endif
30*b1cdbd2cSJim Jagielski #include <com/sun/star/io/XStream.hpp>
31*b1cdbd2cSJim Jagielski #include <com/sun/star/container/XNameAccess.hpp>
32*b1cdbd2cSJim Jagielski #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
33*b1cdbd2cSJim Jagielski #include <com/sun/star/embed/XStorage.hpp>
34*b1cdbd2cSJim Jagielski #include <com/sun/star/embed/ElementModes.hpp>
35*b1cdbd2cSJim Jagielski #include <comphelper/stl_types.hxx>
36*b1cdbd2cSJim Jagielski #include <comphelper/types.hxx>
37*b1cdbd2cSJim Jagielski #include "hsqldb/HStorageAccess.hxx"
38*b1cdbd2cSJim Jagielski #include "hsqldb/HStorageMap.hxx"
39*b1cdbd2cSJim Jagielski #include "hsqldb/StorageNativeInputStream.h"
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski #include "jvmaccess/virtualmachine.hxx"
42*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XSingleComponentFactory.hpp>
43*b1cdbd2cSJim Jagielski #include "accesslog.hxx"
44*b1cdbd2cSJim Jagielski
45*b1cdbd2cSJim Jagielski #include <limits>
46*b1cdbd2cSJim Jagielski
47*b1cdbd2cSJim Jagielski
48*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::container;
49*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::uno;
50*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::document;
51*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::embed;
52*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::io;
53*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::lang;
54*b1cdbd2cSJim Jagielski using namespace ::connectivity::hsqldb;
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
57*b1cdbd2cSJim Jagielski /*****************************************************************************/
58*b1cdbd2cSJim Jagielski /* exception macros */
59*b1cdbd2cSJim Jagielski
60*b1cdbd2cSJim Jagielski #define ThrowException(env, type, msg) { \
61*b1cdbd2cSJim Jagielski env->ThrowNew(env->FindClass(type), msg); }
62*b1cdbd2cSJim Jagielski /*
63*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
64*b1cdbd2cSJim Jagielski * Method: openStream
65*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;I)V
66*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream(JNIEnv * env,jobject,jstring key,jstring name,jint mode)67*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream
68*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jint mode)
69*b1cdbd2cSJim Jagielski {
70*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
71*b1cdbd2cSJim Jagielski {
72*b1cdbd2cSJim Jagielski OperationLogFile( env, name, "input" ).logOperation( "openStream" );
73*b1cdbd2cSJim Jagielski LogFile( env, name, "input" ).create();
74*b1cdbd2cSJim Jagielski }
75*b1cdbd2cSJim Jagielski #endif
76*b1cdbd2cSJim Jagielski StorageContainer::registerStream(env,name,key,mode);
77*b1cdbd2cSJim Jagielski }
78*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
79*b1cdbd2cSJim Jagielski
80*b1cdbd2cSJim Jagielski /*
81*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
82*b1cdbd2cSJim Jagielski * Method: read
83*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;)I
84*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv * env,jobject obj_this,jstring key,jstring name)85*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2
86*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject obj_this,jstring key, jstring name)
87*b1cdbd2cSJim Jagielski {
88*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
89*b1cdbd2cSJim Jagielski OperationLogFile( env, name, "input" ).logOperation( "read()" );
90*b1cdbd2cSJim Jagielski
91*b1cdbd2cSJim Jagielski DataLogFile aDataLog( env, name, "input" );
92*b1cdbd2cSJim Jagielski return read_from_storage_stream( env, obj_this, name, key, &aDataLog );
93*b1cdbd2cSJim Jagielski #else
94*b1cdbd2cSJim Jagielski return read_from_storage_stream( env, obj_this, name, key );
95*b1cdbd2cSJim Jagielski #endif
96*b1cdbd2cSJim Jagielski }
97*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski /*
100*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
101*b1cdbd2cSJim Jagielski * Method: read
102*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;[BII)I
103*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII(JNIEnv * env,jobject obj_this,jstring key,jstring name,jbyteArray buffer,jint off,jint len)104*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII
105*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject obj_this,jstring key, jstring name, jbyteArray buffer, jint off, jint len)
106*b1cdbd2cSJim Jagielski {
107*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
108*b1cdbd2cSJim Jagielski OperationLogFile( env, name, "input" ).logOperation( "read( byte[], int, int )" );
109*b1cdbd2cSJim Jagielski
110*b1cdbd2cSJim Jagielski DataLogFile aDataLog( env, name, "input" );
111*b1cdbd2cSJim Jagielski return read_from_storage_stream_into_buffer( env, obj_this, name, key, buffer, off, len, &aDataLog );
112*b1cdbd2cSJim Jagielski #else
113*b1cdbd2cSJim Jagielski return read_from_storage_stream_into_buffer(env,obj_this,name,key,buffer,off,len);
114*b1cdbd2cSJim Jagielski #endif
115*b1cdbd2cSJim Jagielski }
116*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
117*b1cdbd2cSJim Jagielski
118*b1cdbd2cSJim Jagielski /*
119*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
120*b1cdbd2cSJim Jagielski * Method: close
121*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;)V
122*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close(JNIEnv * env,jobject,jstring key,jstring name)123*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close
124*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
125*b1cdbd2cSJim Jagielski {
126*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
127*b1cdbd2cSJim Jagielski OperationLogFile aOpLog( env, name, "input" );
128*b1cdbd2cSJim Jagielski aOpLog.logOperation( "close" );
129*b1cdbd2cSJim Jagielski aOpLog.close();
130*b1cdbd2cSJim Jagielski
131*b1cdbd2cSJim Jagielski LogFile aDataLog( env, name, "input" );
132*b1cdbd2cSJim Jagielski aDataLog.close();
133*b1cdbd2cSJim Jagielski #endif
134*b1cdbd2cSJim Jagielski StorageContainer::revokeStream(env,name,key);
135*b1cdbd2cSJim Jagielski }
136*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
137*b1cdbd2cSJim Jagielski
138*b1cdbd2cSJim Jagielski /*
139*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
140*b1cdbd2cSJim Jagielski * Method: skip
141*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;J)J
142*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip(JNIEnv * env,jobject,jstring key,jstring name,jlong n)143*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip
144*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jlong n)
145*b1cdbd2cSJim Jagielski {
146*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
147*b1cdbd2cSJim Jagielski OperationLogFile( env, name, "input" ).logOperation( "skip()" );
148*b1cdbd2cSJim Jagielski #endif
149*b1cdbd2cSJim Jagielski
150*b1cdbd2cSJim Jagielski if ( n < 0 )
151*b1cdbd2cSJim Jagielski ThrowException( env,
152*b1cdbd2cSJim Jagielski "java/io/IOException",
153*b1cdbd2cSJim Jagielski "n < 0");
154*b1cdbd2cSJim Jagielski
155*b1cdbd2cSJim Jagielski ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
156*b1cdbd2cSJim Jagielski OSL_ENSURE(pHelper.get(),"No stream helper!");
157*b1cdbd2cSJim Jagielski if ( pHelper.get() )
158*b1cdbd2cSJim Jagielski {
159*b1cdbd2cSJim Jagielski Reference<XInputStream> xIn = pHelper->getInputStream();
160*b1cdbd2cSJim Jagielski if ( xIn.is() )
161*b1cdbd2cSJim Jagielski {
162*b1cdbd2cSJim Jagielski try
163*b1cdbd2cSJim Jagielski {
164*b1cdbd2cSJim Jagielski sal_Int64 tmpLongVal = n;
165*b1cdbd2cSJim Jagielski sal_Int32 tmpIntVal;
166*b1cdbd2cSJim Jagielski
167*b1cdbd2cSJim Jagielski try
168*b1cdbd2cSJim Jagielski {
169*b1cdbd2cSJim Jagielski do {
170*b1cdbd2cSJim Jagielski if (tmpLongVal >= ::std::numeric_limits<sal_Int64>::max() )
171*b1cdbd2cSJim Jagielski tmpIntVal = ::std::numeric_limits<sal_Int32>::max();
172*b1cdbd2cSJim Jagielski else // Casting is safe here.
173*b1cdbd2cSJim Jagielski tmpIntVal = static_cast<sal_Int32>(tmpLongVal);
174*b1cdbd2cSJim Jagielski
175*b1cdbd2cSJim Jagielski tmpLongVal -= tmpIntVal;
176*b1cdbd2cSJim Jagielski
177*b1cdbd2cSJim Jagielski xIn->skipBytes(tmpIntVal);
178*b1cdbd2cSJim Jagielski
179*b1cdbd2cSJim Jagielski } while (tmpLongVal > 0);
180*b1cdbd2cSJim Jagielski }
181*b1cdbd2cSJim Jagielski catch(Exception& )
182*b1cdbd2cSJim Jagielski {
183*b1cdbd2cSJim Jagielski }
184*b1cdbd2cSJim Jagielski
185*b1cdbd2cSJim Jagielski return n - tmpLongVal;
186*b1cdbd2cSJim Jagielski }
187*b1cdbd2cSJim Jagielski catch(Exception& e)
188*b1cdbd2cSJim Jagielski {
189*b1cdbd2cSJim Jagielski OSL_ENSURE(0,"Exception catched! : skip();");
190*b1cdbd2cSJim Jagielski StorageContainer::throwJavaException(e,env);
191*b1cdbd2cSJim Jagielski }
192*b1cdbd2cSJim Jagielski }
193*b1cdbd2cSJim Jagielski }
194*b1cdbd2cSJim Jagielski else
195*b1cdbd2cSJim Jagielski {
196*b1cdbd2cSJim Jagielski ThrowException( env,
197*b1cdbd2cSJim Jagielski "java/io/IOException",
198*b1cdbd2cSJim Jagielski "Stream is not valid");
199*b1cdbd2cSJim Jagielski }
200*b1cdbd2cSJim Jagielski return 0;
201*b1cdbd2cSJim Jagielski }
202*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
203*b1cdbd2cSJim Jagielski
204*b1cdbd2cSJim Jagielski /*
205*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
206*b1cdbd2cSJim Jagielski * Method: available
207*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;)I
208*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available(JNIEnv * env,jobject,jstring key,jstring name)209*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available
210*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name)
211*b1cdbd2cSJim Jagielski {
212*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
213*b1cdbd2cSJim Jagielski OperationLogFile aOpLog( env, name, "input" );
214*b1cdbd2cSJim Jagielski aOpLog.logOperation( "available" );
215*b1cdbd2cSJim Jagielski #endif
216*b1cdbd2cSJim Jagielski
217*b1cdbd2cSJim Jagielski ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
218*b1cdbd2cSJim Jagielski OSL_ENSURE(pHelper.get(),"No stream helper!");
219*b1cdbd2cSJim Jagielski Reference<XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference<XInputStream>();
220*b1cdbd2cSJim Jagielski if ( xIn.is() )
221*b1cdbd2cSJim Jagielski {
222*b1cdbd2cSJim Jagielski try
223*b1cdbd2cSJim Jagielski {
224*b1cdbd2cSJim Jagielski jint nAvailable = xIn->available();
225*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
226*b1cdbd2cSJim Jagielski aOpLog.logReturn( nAvailable );
227*b1cdbd2cSJim Jagielski #endif
228*b1cdbd2cSJim Jagielski return nAvailable;
229*b1cdbd2cSJim Jagielski }
230*b1cdbd2cSJim Jagielski catch(Exception& e)
231*b1cdbd2cSJim Jagielski {
232*b1cdbd2cSJim Jagielski OSL_ENSURE(0,"Exception caught! : available();");
233*b1cdbd2cSJim Jagielski StorageContainer::throwJavaException(e,env);
234*b1cdbd2cSJim Jagielski }
235*b1cdbd2cSJim Jagielski }
236*b1cdbd2cSJim Jagielski else
237*b1cdbd2cSJim Jagielski {
238*b1cdbd2cSJim Jagielski ThrowException( env,
239*b1cdbd2cSJim Jagielski "java/io/IOException",
240*b1cdbd2cSJim Jagielski "Stream is not valid");
241*b1cdbd2cSJim Jagielski }
242*b1cdbd2cSJim Jagielski return 0;
243*b1cdbd2cSJim Jagielski }
244*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
245*b1cdbd2cSJim Jagielski
246*b1cdbd2cSJim Jagielski /*
247*b1cdbd2cSJim Jagielski * Class: com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream
248*b1cdbd2cSJim Jagielski * Method: read
249*b1cdbd2cSJim Jagielski * Signature: (Ljava/lang/String;Ljava/lang/String;[B)I
250*b1cdbd2cSJim Jagielski */
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B(JNIEnv * env,jobject,jstring key,jstring name,jbyteArray buffer)251*b1cdbd2cSJim Jagielski SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B
252*b1cdbd2cSJim Jagielski (JNIEnv * env, jobject /*obj_this*/,jstring key, jstring name, jbyteArray buffer)
253*b1cdbd2cSJim Jagielski {
254*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
255*b1cdbd2cSJim Jagielski OperationLogFile aOpLog( env, name, "input" );
256*b1cdbd2cSJim Jagielski aOpLog.logOperation( "read( byte[] )" );
257*b1cdbd2cSJim Jagielski
258*b1cdbd2cSJim Jagielski DataLogFile aDataLog( env, name, "input" );
259*b1cdbd2cSJim Jagielski #endif
260*b1cdbd2cSJim Jagielski
261*b1cdbd2cSJim Jagielski ::boost::shared_ptr<StreamHelper> pHelper = StorageContainer::getRegisteredStream(env,name,key);
262*b1cdbd2cSJim Jagielski Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>();
263*b1cdbd2cSJim Jagielski OSL_ENSURE(xIn.is(),"Input stream is NULL!");
264*b1cdbd2cSJim Jagielski jint nBytesRead = 0;
265*b1cdbd2cSJim Jagielski if ( xIn.is() )
266*b1cdbd2cSJim Jagielski {
267*b1cdbd2cSJim Jagielski jsize nLen = env->GetArrayLength(buffer);
268*b1cdbd2cSJim Jagielski Sequence< ::sal_Int8 > aData(nLen);
269*b1cdbd2cSJim Jagielski
270*b1cdbd2cSJim Jagielski try
271*b1cdbd2cSJim Jagielski {
272*b1cdbd2cSJim Jagielski nBytesRead = xIn->readBytes(aData,nLen);
273*b1cdbd2cSJim Jagielski }
274*b1cdbd2cSJim Jagielski catch(Exception& e)
275*b1cdbd2cSJim Jagielski {
276*b1cdbd2cSJim Jagielski OSL_ENSURE(0,"Exception catched! : skip();");
277*b1cdbd2cSJim Jagielski StorageContainer::throwJavaException(e,env);
278*b1cdbd2cSJim Jagielski }
279*b1cdbd2cSJim Jagielski
280*b1cdbd2cSJim Jagielski // Casting bytesRead to an int is okay, since the user can
281*b1cdbd2cSJim Jagielski // only pass in an integer length to read, so the bytesRead
282*b1cdbd2cSJim Jagielski // must <= len.
283*b1cdbd2cSJim Jagielski //
284*b1cdbd2cSJim Jagielski if (nBytesRead <= 0) {
285*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
286*b1cdbd2cSJim Jagielski aOpLog.logReturn( (jint)-1 );
287*b1cdbd2cSJim Jagielski #endif
288*b1cdbd2cSJim Jagielski return -1;
289*b1cdbd2cSJim Jagielski }
290*b1cdbd2cSJim Jagielski OSL_ENSURE(nLen >= nBytesRead,"Buffer is too small!");
291*b1cdbd2cSJim Jagielski OSL_ENSURE(aData.getLength() >= nBytesRead,"Buffer is too small!");
292*b1cdbd2cSJim Jagielski env->SetByteArrayRegion(buffer,0,nBytesRead,&aData[0]);
293*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
294*b1cdbd2cSJim Jagielski aDataLog.write( &aData[0], nBytesRead );
295*b1cdbd2cSJim Jagielski #endif
296*b1cdbd2cSJim Jagielski }
297*b1cdbd2cSJim Jagielski #ifdef HSQLDB_DBG
298*b1cdbd2cSJim Jagielski aOpLog.logReturn( nBytesRead );
299*b1cdbd2cSJim Jagielski #endif
300*b1cdbd2cSJim Jagielski return nBytesRead;
301*b1cdbd2cSJim Jagielski }
302*b1cdbd2cSJim Jagielski // -----------------------------------------------------------------------------
303