Java tutorial
//package com.java2s; // This code is licensed under the MIT License. import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { static InputStream createInputStream(final String input) { return input == null ? null : new ByteArrayInputStream(input.getBytes()); } }