fprintf( stderr, "Unable to create the Data buffer: %s\n", e->GetResult() );
jlong Java_vdr_mhp_awt_DFBDataBuffer_createBufferFromData(JNIEnv* env, jobject obj, jbyteArray java_buffer, jint off, jint len){   DFBDataBufferNativeData *data;   int       n;   n = env->GetArrayLength(java_buffer);                             // length   if ( off+len > n )      len = n - off;      data=new DFBDataBufferNativeData();   data->createBuffer(len);      env->GetByteArrayRegion(java_buffer, off, len, data->data);   // GetByteArrayRegion throws an exception if indexes are not valid   if (env->ExceptionOccurred() != NULL) {      delete data;      return 0;   }      DFBDataBufferDescription bufDesc;   bufDesc.flags=DBDESC_MEMORY;   bufDesc.memory.data=data->data;   bufDesc.memory.length=len;   try {      data->buffer=MhpOutput::System::self()->Interface()->CreateDataBuffer(bufDesc);   } catch (DFBException *e) {      fprintf( stderr, "Unable to create the Data buffer: %s\n", e->GetResult() );      printf("DirectFB: Error %s, %s\n", e->GetAction(), e->GetResult());      JNI::Exception::Throw(JNI::JavaIoIOException, "Unable to create data buffer");      delete e;      return 0;   }      return (jlong)data;}