List of utility methods to do InputStream to String Convert
String | InputStreamTOString(InputStream in, String encoding) Input Stream TO String ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] data = new byte[BUFFER_SIZE]; int count = -1; while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) outStream.write(data, 0, count); data = null; return new String(outStream.toByteArray(), encoding); |
String | InputStreamTOString(InputStream in, String encoding) Input Stream TO String ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] data = new byte[BUFFER_SIZE]; int count = -1; while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) outStream.write(data, 0, count); data = null; return new String(outStream.toByteArray(), encoding); |
String | InputStreamTOString(InputStream in, String encoding) This function converts an InputStream in a predefined encoding to a String. ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] data = new byte[BUFFER_SIZE]; int count = -1; while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) outStream.write(data, 0, count); data = null; return new String(outStream.toByteArray(), encoding); |
String | InputStreamTOString(InputStream in, String encoding) Input Stream TO String ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] data = new byte[BUFFER_SIZE]; int count = -1; while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) outStream.write(data, 0, count); data = null; return new String(outStream.toByteArray(), encoding); |
String | InputStreamTOString(InputStream in, String encoding) InputStream to String with encoding ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] data = new byte[BUFFER_SIZE]; int count = -1; while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) { outStream.write(data, 0, count); data = null; return new String(outStream.toByteArray(), encoding); ... |
String | InputStreamTOStringUTF8(InputStream in) Input Stream TO String UTF return InputStreamTOString(in, "UTF-8"); |
String | toString(InputStream is) to String if (null == is) return null; return toStringBuffer(is).toString(); |
String | toString(InputStream is) to String int char_ = 0; ByteArrayBuffer total = new ByteArrayBuffer(0); BufferedReader rd = new BufferedReader(new InputStreamReader(is)); while ((char_ = rd.read()) != -1) { total.append(char_); String output = new String(total.toByteArray()); return output; ... |
String | toString(InputStream is) to String if (null == is) { return null; return toStringBuffer(is).toString(); |
String | toString(InputStream is) to String if (null == is) return null; return toStringBuffer(is).toString(); |