1 #ifndef _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_
2 #define _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_
3 
4 //#include <android_runtime/AndroidRuntime.h>
5 #include "jni.h"
6 
7 class SkMemoryStream;
8 class SkStream;
9 class SkStreamRewindable;
10 class SkWStream;
11 
12 /**
13  *  Return an adaptor from a Java InputStream to an SkStream.
14  *  Does not support rewind.
15  *  @param env JNIEnv object.
16  *  @param stream Pointer to Java InputStream.
17  *  @param storage Java byte array for retrieving data from the
18  *      Java InputStream.
19  *  @return SkStream Simple subclass of SkStream which supports its
20  *      basic methods like reading. Only valid until the calling
21  *      function returns, since the Java InputStream is not managed
22  *      by the SkStream.
23  */
24 SkStream* CreateJavaInputStreamAdaptor(JNIEnv* env, jobject stream,
25                                        jbyteArray storage);
26 
27 /**
28  *  Copy a Java InputStream. The result will be rewindable.
29  *  @param env JNIEnv object.
30  *  @param stream Pointer to Java InputStream.
31  *  @param storage Java byte array for retrieving data from the
32  *      Java InputStream.
33  *  @return SkStreamRewindable The data in stream will be copied
34  *      to a new SkStreamRewindable.
35  */
36 SkStreamRewindable* CopyJavaInputStream(JNIEnv* env, jobject stream,
37                                         jbyteArray storage);
38 
39 SkWStream* CreateJavaOutputStreamAdaptor(JNIEnv* env, jobject stream,
40                                          jbyteArray storage);
41 
42 #endif  // _ANDROID_GRAPHICS_CREATE_JAVA_OUTPUT_STREAM_ADAPTOR_H_
43