Java Utililty Methods InputStream Create

List of utility methods to do InputStream Create

Description

The list of methods to do InputStream Create are organized into topic(s).

Method

InputStreamtoInputStream(String input)
Convert the specified string to an input stream, encoded as bytes using the default character encoding of the platform.
byte[] bytes = input.getBytes();
return new ByteArrayInputStream(bytes);
InputStreamtoInputStream(String input, String encoding)
to Input Stream
byte bytes[] = encoding == null ? input.getBytes() : input.getBytes(encoding);
return new ByteArrayInputStream(bytes);
InputStreamtoInputStream(String result, String encoding)
Returns an input stream serving the given argument
try {
    return new ByteArrayInputStream(result.getBytes(encoding));
} catch (UnsupportedEncodingException ex) {
    throw new RuntimeException("Unsupported encoding", ex);
InputStreamtoInputStream(String s, String charSet)
to Input Stream
return new ByteArrayInputStream(s.getBytes(charSet));
InputStreamtoInputStream(String source)
to Input Stream
byte[] data = fromIdentityEncodedString(source);
return new ByteArrayInputStream(data);
InputStreamtoInputStream(String text)
to Input Stream
return new ByteArrayInputStream(text.getBytes());
InputStreamtoInputStream(String value)
to Input Stream
if (value == null) {
    return null;
return new ByteArrayInputStream(value.getBytes("UTF-8"));
InputStreamtoInputStream(String[] stringArray)
to Input Stream
return toInputStream(stringArray, 0);
InputStreamtoInputStreamFromBase64(String inBase64String)
to Input Stream From Base
if (inBase64String == null) {
    return null;
return new ByteArrayInputStream(toBytesFromBase64(inBase64String));