473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

[JNI] how to modify java array in the C++ code ?

in the java code :

byte [ ] aPictArrayUnpacked = new byte [ 3 ] ;

in the c++ code :

JNIEXPORT void JNICALL Java_tracker_UnpackPict (
JNIEnv * aEnv ,
jobject aObj ,
jbyteArray aPictArrayUnpacked )
{
jbyte * lBodyUnpacked = aEnv -> GetByteArrayElements (
aPictArrayUnpacked , 0 ) ;

memset ( lBodyUnpacked , 0 , 3 ) ;

aEnv -> ReleaseByteArrayElements ( aPictArrayPacked , lBodyPacked ,
0 ) ;
}

it crash on the memset.

what should I do ?

thanks

yomgui

Jul 17 '05 #1
0 1749

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric | last post by:
Hi, After reading the JNI specs, it looks like no JNI call is available to retrieve the reference count for a specific Java Object (LocalRef or GlobalRef). I would like to able to retrieve...
19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
4
by: Tim Wong | last post by:
I have a java method setup where it will be accessed in C++ via JNI. The process is as follows: 1) C++ function getObject(...) is called. 2) getObject(...) uses JNI to access a java class...
1
by: Marcelo | last post by:
Hello, I am trying to modify some color information from java to C. I have the information given by java in a format ARGB and I would like to convert it as: RRRR...GGGG...BBB.... without the...
2
by: David Stevenson | last post by:
Programs from: Sheng Liang, The Java Native Interface, Programmer's Guide and Specification, The Java Series, (c) 1999, pp. 38-39. I thought I copied the program pretty exactly, but I don't know...
2
by: gautam.chavan | last post by:
hello all, I have a C++ file, which calls a c++ library which returns a Vector<Struct> My C++ File is invoked via a Jni call... Instead of parsing the vector & returning an Object array back to...
4
by: the.new.delboy | last post by:
Hi, I'm working on an application which requires some native calls to be made from Java. The calls work fine in one version of my code. I need to change the location of my native calls to a...
1
by: | last post by:
Hi all, I am writing a sendmail milter application in Java. The incoming mails will usually have image file as attachments. My application is currently able to extract the ImageFile and save it...
6
by: jthep | last post by:
Hi I'm trying to write a JNI for a linkedlist class I wrote in C++. Basically I have a header file with the class definition and a C++ file with the definition of the class member functions. I...
2
myusernotyours
by: myusernotyours | last post by:
Hi All, Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.