@Test
public void testWritesPng() throws Exception {

	InputStream is = new InputStream() {
		private int calls = 10;
		@Override
		public int read() throws IOException {
			if (calls < 20) return calls++;
			else return -1;
		}
	};
	InputStreamWriter writer = new InputStreamWriter(is);
	File file = new File(getContext().getCacheDir(), "test_file");
	boolean result = writer.write(file);
	Assert.assertTrue(result);
	file = new File(getContext().getCacheDir(), "test_file");
	Assert.assertTrue(file.exists());
}