ByteArrayInputStream also does the trick:
InputStream is = new ByteArrayInputStream( myString.getBytes( charset ) );
Then convert to reader:
InputStreamReader reader = new InputStreamReader(is);
More Related Contents:
- How do I read / convert an InputStream into a String in Java?
- Get an OutputStream into a String
- StringBuilder vs String concatenation in toString() in Java
- How do I convert from int to String?
- Sort on a string that may contain a number
- String’s Maximum length in Java – calling length() method
- How to split a comma-separated string?
- Java, Calculate the number of days between two dates [duplicate]
- How to remove duplicate white spaces in string using Java?
- Isn’t the size of character in Java 2 bytes?
- Converting an int to a binary string representation in Java?
- Difference between “char” and “String” in Java
- Fatal Error: Invalid Layout of java.lang.String at value
- String replacement in java, similar to a velocity template
- How to center a string using String.format?
- Read String line by line
- How to get the last characters in a String in Java, regardless of String size
- How do I convert a byte array with null terminating character to a String in Java?
- What is the difference between String and StringBuffer in Java?
- How to replace � in a string
- How to remove large if-else-if chain [duplicate]
- Java – checking if parseInt throws exception
- Find all numbers in the String [closed]
- How to parse this string in Java?
- Is it possible in Java to override ‘toString’ for an Objects array?
- Java: how to initialize String[]?
- Java Scanner class reading strings
- Quotation marks inside a string [duplicate]
- Java – How to visually center a specific string (not just a font) in a rectangle
- How can I print a string adding newlines in Java?