23#include <osl/diagnose.h>
32jclass java_sql_Blob::theClass =
nullptr;
33java_sql_Blob::java_sql_Blob( JNIEnv * pEnv, jobject myObj )
58 static const char *
const cSignature =
"()J";
59 static const char *
const cMethodName =
"length";
61 static jmethodID mID(
nullptr);
63 out =
t.pEnv->CallLongMethod(
object, mID );
66 return static_cast<sal_Int64
>(out);
72 css::uno::Sequence< sal_Int8 >
aSeq;
75 static const char *
const cSignature =
"(JI)[B";
76 static const char *
const cMethodName =
"getBytes";
78 static jmethodID mID(
nullptr);
80 jbyteArray out =
static_cast<jbyteArray
>(
t.pEnv->CallObjectMethod(
object, mID,
pos,
count));
85 aSeq.realloc(
t.pEnv->GetArrayLength(out));
86 memcpy(
aSeq.getArray(),
t.pEnv->GetByteArrayElements(out,&
p),
aSeq.getLength());
87 t.pEnv->DeleteLocalRef(out);
97 static jmethodID mID(
nullptr);
98 jobject out =
callObjectMethod(
t.pEnv,
"getBinaryStream",
"()Ljava/io/InputStream;", mID);
110 static const char *
const cSignature =
"([BI)J";
111 static const char *
const cMethodName =
"position";
113 static jmethodID mID(
nullptr);
116 jbyteArray pByteArray =
t.pEnv->NewByteArray(pattern.getLength());
117 jbyte * patternData =
reinterpret_cast<jbyte *
>(
118 const_cast<sal_Int8 *
>(pattern.getConstArray()));
125 t.pEnv->SetByteArrayRegion(pByteArray,0,pattern.getLength(),patternData);
126 out =
t.pEnv->CallLongMethod(
object, mID, pByteArray,
start );
127 t.pEnv->DeleteLocalRef(pByteArray);
130 return static_cast<sal_Int64
>(out);
jobject callObjectMethod(JNIEnv *pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
static void ThrowSQLException(JNIEnv *pEnv, const css::uno::Reference< css::uno::XInterface > &_rContext)
static jclass findMyClass(const char *_pClassName)
void obtainMethodId_throwSQL(JNIEnv *_pEnv, const char *_pMethodName, const char *_pSignature, jmethodID &_inout_MethodID) const
virtual sal_Int64 SAL_CALL positionOfBlob(const css::uno::Reference< css::sdbc::XBlob > &pattern, sal_Int64 start) override
virtual ~java_sql_Blob() override
virtual sal_Int64 SAL_CALL position(const css::uno::Sequence< sal_Int8 > &pattern, sal_Int64 start) override
virtual sal_Int64 SAL_CALL length() override
virtual jclass getMyClass() const override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int64 pos, sal_Int32 length) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream() override
Sequence< sal_Int8 > aSeq