1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-17 23:15:10 -05:00

Merge pull request #67 from andrewgaul/utility-readinputstream

Remove unused Utility.readInputStream
This commit is contained in:
Jesse Vincent 2011-10-20 05:32:23 -07:00
commit 70b4f64138

View File

@ -12,9 +12,6 @@ import com.fsck.k9.mail.filter.Base64;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -36,17 +33,6 @@ public class Utility {
private static final Pattern TAG_PATTERN = Pattern.compile("\\[[-_a-z0-9]+\\] ", private static final Pattern TAG_PATTERN = Pattern.compile("\\[[-_a-z0-9]+\\] ",
Pattern.CASE_INSENSITIVE); Pattern.CASE_INSENSITIVE);
public static String readInputStream(InputStream in, String encoding) throws IOException {
InputStreamReader reader = new InputStreamReader(in, encoding);
StringBuilder sb = new StringBuilder();
int count;
char[] buf = new char[512];
while ((count = reader.read(buf)) != -1) {
sb.append(buf, 0, count);
}
return sb.toString();
}
public static boolean arrayContains(Object[] a, Object o) { public static boolean arrayContains(Object[] a, Object o) {
for (Object element : a) { for (Object element : a) {
if (element.equals(o)) { if (element.equals(o)) {