Given a Instream containing ASCII values, the task is to convert this Instream into a String containing the characters corresponding to the ASCII values.
Input: IntStream = 71, 101, 101, 107, 115 Output: Geeks Input: IntStream = 71, 101, 101, 107, 115, 70, 111, 114, 71, 101, 101, 107, 115 Output: GeeksForGeeks
- Get the Instream to be converted.
- Convert the IntStream into String with the help of StringBuilder
- Collect the formed StringBuilder
- Convert the StringBuilder into String using toString() methods.
- Print the formed String.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.