diff -r f5050f1da672 -r 04becd199f91 javacommons/gcfbase/src/streamsjni.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfbase/src/streamsjni.cpp Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains all JNI calls made by StreamConnectionBase +* +*/ + + +#include "nativestreambase.h" +#include "com_nokia_mj_impl_gcf_utils_StreamConnectionBase.h" + + +using namespace java; + +JNIEXPORT jint JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1readbytes +(JNIEnv *aJni, jobject /*peer*/, jint nativePeer, jbyteArray aBytes) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + return nativeConn->readBytes(*aJni, aBytes); +} + + +JNIEXPORT jint JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1writebytes +(JNIEnv *aJni, jobject /*peer*/, jint nativePeer, jbyteArray aBytes, + int aOffset, int aLength) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + return nativeConn->writeBytes(*aJni, aBytes, aOffset , aLength); +} + + +JNIEXPORT void JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1stopreading +(JNIEnv* /*aJni*/, jobject /*peer*/, jint nativePeer) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + nativeConn->stopReading(); +} + +JNIEXPORT void JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1stopwriting +(JNIEnv* /*aJni*/, jobject /*peer*/, jint nativePeer) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + nativeConn->stopWriting(); +} + +JNIEXPORT void JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1setNativeBufferSize +(JNIEnv* /*aJni*/, jobject /*peer*/, jint nativePeer, jint size) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + nativeConn->setBufferSize(size); +} + +JNIEXPORT jint JNICALL +Java_com_nokia_mj_impl_gcf_utils_StreamConnectionBase__1available +(JNIEnv* /*aJni*/, jobject /*peer*/, jint nativePeer) +{ + NativeStreamBase* nativeConn = + reinterpret_cast(nativePeer); + + return nativeConn->available(); +} +