src/core/android/SDL_android.cpp
changeset 7368 0e12e09df086
parent 7246 be3beed886ea
equal deleted inserted replaced
7367:d6eabafa8776 7368:0e12e09df086
   755         /* Don't read more bytes than those that remain in the file, otherwise we get an exception */
   755         /* Don't read more bytes than those that remain in the file, otherwise we get an exception */
   756         if (bytesRemaining >  bytesMax) bytesRemaining = bytesMax;
   756         if (bytesRemaining >  bytesMax) bytesRemaining = bytesMax;
   757 
   757 
   758         JNIEnv *mEnv = Android_JNI_GetEnv();
   758         JNIEnv *mEnv = Android_JNI_GetEnv();
   759         if (!refs.init(mEnv)) {
   759         if (!refs.init(mEnv)) {
   760             return -1;
   760             return 0;
   761         }
   761         }
   762 
   762 
   763         jobject readableByteChannel = (jobject)ctx->hidden.androidio.readableByteChannelRef;
   763         jobject readableByteChannel = (jobject)ctx->hidden.androidio.readableByteChannelRef;
   764         jmethodID readMethod = (jmethodID)ctx->hidden.androidio.readMethod;
   764         jmethodID readMethod = (jmethodID)ctx->hidden.androidio.readMethod;
   765         jobject byteBuffer = mEnv->NewDirectByteBuffer(buffer, bytesRemaining);
   765         jobject byteBuffer = mEnv->NewDirectByteBuffer(buffer, bytesRemaining);