MCPcopy Create free account
hub / github.com/buggins/coolreader / jbyteArrayToStream

Method jbyteArrayToStream

android/jni/cr3java.cpp:150–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150LVStreamRef CRJNIEnv::jbyteArrayToStream( jbyteArray array )
151{
152 if ( !array )
153 return LVStreamRef();
154 int len = env->GetArrayLength(array);
155 if ( !len )
156 return LVStreamRef();
157 lUInt8 * data = (lUInt8 *)env->GetByteArrayElements(array, 0);
158 LVStreamRef res = LVCreateMemoryStream(data, len, true, LVOM_READ);
159 env->ReleaseByteArrayElements(array, (jbyte*)data, 0);
160 return res;
161}
162
163jbyteArray CRJNIEnv::streamToJByteArray( LVStreamRef stream )
164{

Calls 1

LVCreateMemoryStreamFunction · 0.85

Tested by

no test coverage detected