public class ToolsUtils {
public static String ReadTools(InputStream is) {
try {
byte[] b = new byte[1024];
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int index = 0;
while ((index = is.read(b)) != -1) {
baos.write(new String(b, 0, index, "GBK").getBytes());
}
return baos.toString();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}
public static String ReadTools(InputStream is) {
try {
byte[] b = new byte[1024];
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int index = 0;
while ((index = is.read(b)) != -1) {
baos.write(new String(b, 0, index, "GBK").getBytes());
}
return baos.toString();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}