473,408 Members | 2,888 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,408 software developers and data experts.

[JNI] how to modify a 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 (
aPictArrayUnpacked ,
lBodyUnpacked ,
0 ) ;
}

it crashes on the memset. what should I do ?

thanks
yomgui

Jul 17 '05 #1
0 1690

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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.