java.io
Class Reader

java.lang.Object
  |
  +--java.io.Reader
Direct Known Subclasses:
InputStreamReader

public abstract class Reader
extends Object

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


Field Summary
protected  Object lock
           
 
Constructor Summary
protected Reader()
          Reader를 생성한다.
protected Reader(Object lock)
          Reader를 생성한다.
 
Method Summary
abstract  void close()
          입력 스트림을 닫는다.
 void mark(int readLimit)
          mark를 설정한다.
 boolean markSupported()
          mark 기능을 지원하는지 여부를 구한다.
 int read()
          한 문자를 읽는다.
 int read(char[] buf)
          문자배열로 문자를 읽는다.
abstract  int read(char[] buf, int offset, int count)
          문자배열 특정 부분으로 문자를 읽는다.
 boolean ready()
          현 입력스트림에서 문자를 읽을 수 있는 지 여부를 구한다.
 void reset()
          읽을 위치를 mark로 설정된 위치로 변경한다.
 long skip(long count)
          특정 갯수의 문자를 읽지 않고 건너 뛴다.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

protected Object lock
Constructor Detail

Reader

protected Reader()
Reader를 생성한다. 동기화를 위한 lock은 자기자신을 사용한다.

Reader

protected Reader(Object lock)
Reader를 생성한다. 동기화를 위한 lock은 매개변수로 받은 객체를 사용한다.
Method Detail

read

public int read()
         throws IOException
한 문자를 읽는다.
Returns:
성공하면 읽은 문자 읽은 문자가 없으면 -1.
Throws:
IOException -  

read

public int read(char[] buf)
         throws IOException
문자배열로 문자를 읽는다.
Parameters:
buf - 읽을 문자를 저장할 문자배열.
Returns:
실제 읽은 문자 갯수 읽은 문자가 없으면 -1.
Throws:
IOException -  

read

public abstract int read(char[] buf,
                         int offset,
                         int count)
                  throws IOException
문자배열 특정 부분으로 문자를 읽는다.
Parameters:
buf - 읽을 문자를 저장할 문자배열.
offset - 읽은 문자를 저장할 시작 위치.
count - 읽을 문자 갯수.
Returns:
실제 읽은 문자 갯수 읽은 문자가 없으면 -1.
Throws:
IOException -  

close

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

mark

public void mark(int readLimit)
          throws IOException
mark를 설정한다.
Throws:
IOException -  

markSupported

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

ready

public boolean ready()
              throws IOException
현 입력스트림에서 문자를 읽을 수 있는 지 여부를 구한다.
Returns:
아직 읽을 준비가 안‰瑛만