Code example for InputStreamReader

0
    public InputStream getInputStream() {
        return new ByteArrayInputStream(data);
    } 
 
    public Reader getReader() {
        return new InputStreamReader(getInputStream());
    } 
 
    public byte[] getData() { 
        return data;
    } 
 
    public String toString() {
        return "BytesSource[" + new String(data) + "]";
    } 
}