Back to project page android-shape-imageview.
The source code is released under:
Apache License
If you think the Android project android-shape-imageview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.siyamed.shapeimageview.path.parser; /* w ww. j a v a 2 s . com*/ import android.util.Log; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; class CopyInputStream { private static final String TAG = SvgToPath.TAG; private final InputStream _is; private ByteArrayOutputStream _copy; public CopyInputStream(InputStream is) { _is = is; try { copy(); } catch(IOException ex) { Log.w(TAG, "IOException in CopyInputStream " + ex.toString()); } } private void copy() throws IOException { _copy = new ByteArrayOutputStream(); int chunk; byte[] data = new byte[256]; while(-1 != (chunk = _is.read(data))) { _copy.write(data, 0, chunk); } _copy.flush(); } public ByteArrayInputStream getCopy() { return new ByteArrayInputStream(_copy.toByteArray()); } }