java.io
Class InputStreamReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.InputStreamReader

public class InputStreamReader
extends Reader

바이트 입력 스트림을 문자 스트림으로 변환해주는 클래스.


Fields inherited from class java.io.Reader
lock
 
Constructor Summary
InputStreamReader(InputStream in)
          새로운 객체를 생성한다.
InputStreamReader(InputStream in, String encoding_name)
          특정 디코더를 사용하는 새로운 객체를 생성한다.
 
Method Summary
 void close()
          입력 스트림을 닫는다.
 void mark(int readAheadLimit)
          mark를 설정한다.
 boolean markSupported()
          mark 기능을 지원하는지 여부를 구한다.
 int read()
          한 문자를 읽는다.
 int read(char[] buf, int offset, int len)
          문자 배열의 일부분으로 읽어 들인다.
 boolean ready()
          정보를 읽을 수 있느지 여부를 구한다.
 void reset()
          읽을 위치를 mark로 설정된 위치로 변경한다.
 long skip(long n)
          입력 스트림에서 특정 갯수의 문자을 건너뛴다.
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamReader

public InputStreamReader(InputStream in)
새로운 객체를 생성한다. 바이트에서 문자로 바꿀 때 쓰는 디코더는 VM의 디폴르 설정을 따른다.
Parameters:
in - 바이트 정보를 읽을 입력 스트림.

InputStreamReader

public InputStreamReader(InputStream in,
                         String encoding_name)
                  throws UnsupportedEncodingException
특정 디코더를 사용하는 새로운 객체를 생성한다.
Parameters:
in - 바이트 정보를 읽을 입력 스트림.
encoding_name - 사용할 디코더.
Throws:
UnsupportedEncodingException - encoding_name이 지원할 수 없는 방식일 때 발생.
Method Detail

ready

public boolean ready()
              throws IOException
정보를 읽을 수 있느지 여부를 구한다.
Overrides:
ready in class Reader
Returns:
읽을 수 있으면 true 아니면 false.
Throws:
IOException -  

read

public int read()
         throws IOException
한 문자를 읽는다.
Overrides:
read in class Reader
Returns:
읽은 한문자.
Throws:
IOException -  

read

public int read(char[] buf,
                int offset,
                int len)
         throws IOException
문자 배열의 일부분으로 읽어 들인다.
Overrides:
read in class Reader
Parameters:
buf - 읽은 문자를 저장할 문자 배열.
offset - buf에서 읽은 문자를 저장할 시작 위치.
len - 읽은 문자의 갯수.
Returns:
실제 읽은 문자 수
Throws:
IOException -  

skip

public long skip(long n)
          throws IOException
입력 스트림에서 특정 갯수의 문자을 건너뛴다.
Overrides:
skip in class Reader
Parameters:
n - 건너 뛸 문자 수.
Returns:
실제 건너 뛴 문자 수.
Throws:
IOException -  

markSupported

public boolean markSupported()
mark 기능을 지원하는지 여부를 구한다.
Overrides:
markSupported in class Reader
Returns:
지원하면 true 아니면 false.

mark

public void mark(int readAheadLimit)
          throws IOException
mark를 설정한다.
Overrides:
mark in class Reader
Following copied from class: java.io.Reader
Throws:
IOException -  

reset

public void reset()
           throws IOException
읽을 위치를 mark로 설정된 위치로 변경한다.
Overrides:
reset in class Reader
Throws:
IOException -  

close

public void close()
           throws IOException
입력 스트림을 닫는다.
Overrides:
close in class Reader
Throws:
IOException -  


AromaSoft Corp. Proprietary and Confidential

(C)opyright 2003 AromaSoft Corp. All right reserved.
Contact : contact@aromasoft.com