]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src/jnistream.hxx
PipeRun reverse action
[simantics/3d.git] / org.jcae.opencascade / src / jnistream.hxx
1 #ifndef JNISTREAM_H
2 #define JNISTREAM_H 
3
4 // standard C++ with new header file names and std:: namespace
5 #include <iostream>
6 #include <jni.h>
7
8 class jnistreambuf : public std::streambuf
9 {
10 public:
11     jnistreambuf(JNIEnv * env, jobject stream, int bufferSize = 1024);
12     virtual int overflow( int c = EOF);
13     virtual int underflow();
14     virtual int sync();
15         ~jnistreambuf();
16 private:
17         int flush_buffer();
18         char * nativeBuffer;
19         JNIEnv * env;
20         jmethodID readMID, writeMID;
21         jobject jstream, fullNioBuffer;
22 };
23
24 #endif