Loading core/java/android/util/Base64InputStream.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class Base64InputStream extends FilterInputStream { if (outputStart >= outputEnd) { return -1; } else { return coder.output[outputStart++]; return coder.output[outputStart++] & 0xff; } } Loading core/tests/coretests/src/android/util/Base64Test.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.util; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import junit.framework.TestCase; import java.io.ByteArrayInputStream; Loading Loading @@ -404,6 +407,14 @@ public class Base64Test extends TestCase { } } /** http://b/3026478 */ public void testSingleByteReads() throws IOException { InputStream in = new Base64InputStream( new ByteArrayInputStream("/v8=".getBytes()), Base64.DEFAULT); assertEquals(254, in.read()); assertEquals(255, in.read()); } /** * Tests that Base64OutputStream produces exactly the same results * as calling Base64.encode/.decode on an in-memory array. Loading Loading
core/java/android/util/Base64InputStream.java +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class Base64InputStream extends FilterInputStream { if (outputStart >= outputEnd) { return -1; } else { return coder.output[outputStart++]; return coder.output[outputStart++] & 0xff; } } Loading
core/tests/coretests/src/android/util/Base64Test.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.util; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import junit.framework.TestCase; import java.io.ByteArrayInputStream; Loading Loading @@ -404,6 +407,14 @@ public class Base64Test extends TestCase { } } /** http://b/3026478 */ public void testSingleByteReads() throws IOException { InputStream in = new Base64InputStream( new ByteArrayInputStream("/v8=".getBytes()), Base64.DEFAULT); assertEquals(254, in.read()); assertEquals(255, in.read()); } /** * Tests that Base64OutputStream produces exactly the same results * as calling Base64.encode/.decode on an in-memory array. Loading