자바 리 턴 흐름

2479 단어
 1 import java.io.ByteArrayInputStream;
2 import java.io.IOException;
3 import java.io.PushbackInputStream;
4
5
6 public class PushInputStreamDemo {
7 public static void main(String[] args) throws Exception {
8 String str="www.hjw.com";
9 ByteArrayInputStream bai=new ByteArrayInputStream(str.getBytes());
10 PushbackInputStream push=new PushbackInputStream(bai);
11 System.out.println(" :");
12 int temp=0;
13 while((temp=push.read())!=-1){
14 if(temp=='.'){
15 push.unread(temp);
16 temp=push.read();
17 System.out.print("( "+(char)temp+")");// ,
18 }else{
19 System.out.print((char)temp);
20 }
21 }
22 }
23 }

 
다음으로 전송:https://www.cnblogs.com/dennisac/archive/2012/03/26/2418413.html

좋은 웹페이지 즐겨찾기