jni « API « Java I/O Q&A





1. Byte stream / C / JNI    stackoverflow.com

What data types are usually used in C API implementation for storing byte streams? How can I convert this type to jbyteArray?

2. Sharing output streams through a JNI interface    stackoverflow.com

I am writing a Java application that uses a C++ library through a JNI interface. The C++ library creates objects of type Foo, which are duly passed up through JNI to ...

3. Getting text data from C++ using JNI through std::ostream into Java    stackoverflow.com

I have a class in C++ which takes an std::ostream as an argument in order to continuously output text (trace information). I need to get this text over to the Java ...

4. Which JVMs do not support direct java.nio.ByteBuffer?    stackoverflow.com

The release notes for Java NIO (in Java 1.4+) state that support for direct ByteBuffers is an optional feature. I am curious which JVM vendors/flavors do not support ...

5. JNI Stream binary data from C++ to Java    stackoverflow.com

I need help passing binary data into Java. I'm trying to use jbytearray but when the data gets into Java it appears corrupt. Can somebody give me a hand? Here's a snip ...

6. JNI - native method with ByteBuffer parameter    stackoverflow.com

I've got a method:

public native void doSomething(ByteBuffer in, ByteBuffer out);
Generated by javah C/C++ header of this method is:
JNIEXPORT void JNICALL Java__MyClass_doSomething (JNIEnv *, jobject, jobject, jobject, jint, jint);
How can I get ...

7. Java Input/Output streams for unnamed pipes created in native code?    stackoverflow.com

Is there a way to easily create Java Input/Output streams for unnamed pipes created in native code? Motivation: I need my own implementation of the Process class. The native code spawns me ...

8. What's causing "Unable to retrieve native address from ByteBuffer object"?    stackoverflow.com

As a very novice Java programmer, I probably should not mess with that kind of things. Unfortunately, I'm using a library which have a method that accepts a ByteBuffer object and ...

9. How to move data from java InputStream to a char * in c++ with jni?    stackoverflow.com

How can I move the data stored in a java InputStream to a char * in c++ using JNI? Thanks, Carlos.





10. How to write/read the direct ByteBuffer in the native?    stackoverflow.com

I want to receive data from a socket in native part and then read the data in the Java code. I know that the direct ByteBuffer might be a good choice. So ...

11. How to convert byte[] to bytebuffer native memory?    stackoverflow.com

I need pass a large amount memory to jni side to parse it. I used GetByteArrayElements to get the native pointer before.but i found this method is always copy the memory,not using ...