Java InputStream Create getInputStream(String content)

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

Description

get Input Stream

License

Apache License

Declaration

public static final InputStream getInputStream(String content) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static final InputStream getInputStream(String content) {
        try {/*from   w ww  .  java  2s.  co  m*/
            return new ByteArrayInputStream(content.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Problem generating input stream");
        }
    }
}

Related

  1. getInputStream(final File file)
  2. getInputStream(final File file, final boolean createFile)
  3. getInputStream(final Serializable obj)
  4. getInputStream(final String fileName)
  5. getInputStream(final String sourceFolder, final Class clazz)
  6. getInputStream(String data)
  7. getInputStream(String fileName)
  8. getInputStream(String fileName)
  9. getInputStream(String fileName)