Java Utililty Methods BufferedInputStream Create

List of utility methods to do BufferedInputStream Create

Description

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

Method

InputStreamgetInputStreamFromEncodedStr(String encodedDetails)
get Input Stream From Encoded Str
BASE64Decoder decoder = new BASE64Decoder();
byte b[] = decoder.decodeBuffer(encodedDetails);
return new ByteArrayInputStream(b);
InputStreamgetInputStreamFromString(String _string)
Get an input stream from a source String.
return (new ByteArrayInputStream(_string.getBytes("UTF-8")));
InputStreamgetInputStreamFromString(String _string)
Get an InputStream from a String instance.
try {
    return (new ByteArrayInputStream(_string.getBytes("UTF-8")));
} catch (java.io.UnsupportedEncodingException e) {
    return null;
InputStreamgetInputStreamFromString(String input)
Retrieves an input stream whose contents will be the value of a String.
return new ByteArrayInputStream(input.getBytes());
InputStreamgetInputStreamFromString(String s)
get Input Stream From String
return new ByteArrayInputStream(s.getBytes());
InputStreamgetStream(byte[] bytes)
get Stream
return new ByteArrayInputStream(bytes);
InputStreamgetStream(final File file)
get Stream
if (file == null) {
    throw new IllegalArgumentException("file can't be null");
if (file.exists() == false) {
    throw new IllegalArgumentException("file dosen't exist : " + file.getAbsolutePath());
try {
    return new BufferedInputStream(new FileInputStream(file));
...
InputStreamgetStream(final String string, final String codePage)
Get inputstream from string
return new ByteArrayInputStream(string.getBytes(codePage));
ZipInputStreamgetStream(InputStream is)
get Stream
return (is instanceof ZipInputStream ? (ZipInputStream) is
        : is instanceof BufferedInputStream ? new ZipInputStream(is)
                : new ZipInputStream(new BufferedInputStream(is)));
BufferedInputStreamgetStream(String name)
get Stream
InputStream in = Main.class.getResourceAsStream(name);
if (in == null)
    return null;
return new BufferedInputStream(in);