ByteArrayInputStream example

xiaoxiao2021-04-01  221

import java.io *;. class ByteArrayInputStreamDemo {public static void main (String [] args) {String strTmp = "ShengJiahui"; byte b [] = strTmp.getBytes (); ByteArrayInputStream in = new ByteArrayInputStream (b);

For (int i = 0; i <2; i ) {INT C; while ((c = in.read ())! = - 1) {if (i == 0) {system.out.print ((charr) );} else {system.out.print (character.touppercase ((char) c));}} system.out.println (); in.Reset ();}}}

转载请注明原文地址:https://www.9cbs.com/read-131162.html

New Post(0)