Index: libadblockplus-android/jni/Utils.cpp |
diff --git a/libadblockplus-android/jni/Utils.cpp b/libadblockplus-android/jni/Utils.cpp |
index 6c1b9274c417a4cfa8f93b37314d858bae94c188..bb0db640fdf125766621345e9e6c46ee5a8656c5 100644 |
--- a/libadblockplus-android/jni/Utils.cpp |
+++ b/libadblockplus-android/jni/Utils.cpp |
@@ -16,6 +16,8 @@ |
*/ |
#include <string> |
+#include <sstream> |
+#include <iostream> |
#include "Utils.h" |
@@ -122,3 +124,13 @@ jobject NewJniNotification(JNIEnv* env, |
{ |
return NewJniObject(env, notification, PKG("Notification")); |
} |
+ |
+std::string JniStdStreamToStdString(std::istream *in) |
+{ |
+ std::string ret; |
+ char buffer[1024]; |
+ while (in->read(buffer, sizeof(buffer))) |
+ ret.append(buffer, sizeof(buffer)); |
+ ret.append(buffer, in->gcount()); |
+ return ret; |
+} |