1int byteCount;
2 byte[] tmp = new byte[BUFSIZE];
3 encodedContent = "";
4
5 do {
6 byteCount = is.read(tmp, 0, BUFSIZE);
7 if (byteCount == -1) break;
8 encodedContent += Base64.encodeToString(tmp, 0, byteCount, Base64.NO_WRAP);
9 } while (byteCount != -1);
2 byte[] tmp = new byte[BUFSIZE];
3 encodedContent = "";
4
5 do {
6 byteCount = is.read(tmp, 0, BUFSIZE);
7 if (byteCount == -1) break;
8 encodedContent += Base64.encodeToString(tmp, 0, byteCount, Base64.NO_WRAP);
9 } while (byteCount != -1);
In the above code, the String encodedContent seems to be taking twice as much space as expected. For example, it grows by at most BUFSIZE (64 K
