Code example for ByteArrayInputStream

0
  public StringStreamSource(String string) {
    this.string = string;
  } 
 
  public InputStream getInputStream() {
    return new ByteArrayInputStream(string.getBytes());
  } 
 
  public String toString() {
    return "String"; 
  } 
}