Java InputStream Create getInputStream(String str)

Here you can find the source of getInputStream(String str)

Description

Returns an InputStream given a String str

License

BSD License

Parameter

Parameter Description
str a parameter

Declaration

public static InputStream getInputStream(String str) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright Duke Comprehensive Cancer Center and SemanticBits
 * //  w  w  w .  j av  a2s.  c  o  m
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/c3pr/LICENSE.txt for details.
 ******************************************************************************/

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class Main {
    /**
     * Returns an InputStream given a String str
     * 
     * @param str
     * @return
     */
    public static InputStream getInputStream(String str) {

        byte[] b = str.getBytes();

        ByteArrayInputStream iStream = new ByteArrayInputStream(b);
        return iStream;
    }
}

Related

  1. getInputStream(String parentFolder, String fileName)
  2. getInputStream(String path)
  3. getInputStream(String path)
  4. getInputStream(String path)
  5. getInputStream(String sPath)
  6. getInputStream(String text)
  7. getInputStream(String thePath)
  8. getInputStream(String url)
  9. getInputStream(String xmlStr)