FileInputStream의 주요 메소드

CODEDRAGON Development/Java

반응형

 

 

FileInputStream의 주요 메소드

FileInputStream의 메소드 

설명 

int available() throws IOException

현재 읽을 수 있는 바이트 수를 반환

int close() throws IOException

InputStream을 닫기

int read() throws IOException

InputStream에서 한 바이트를 읽어서 int 값으로 반환

int read(byte buf[]) throws IOException

InputStream에서 buf[] 크기만큼을 읽어 buf에 저장하고 읽은 바이트 수를 반환

int read(byte buf[], int offset, int numBytes) throws IOException

InputStream에서 nnumBytes만큼을 읽어 buf[] offset 위치부터 저장하고 읽은 바이트 수를 반환

int skip(long numBytes)

throws IOException

numBytes로 지정된 바이트를 스킵하고 스킵된 바이트 수를 반환

protected void finalize()

더이상 참조하는 것이 없을 경우 close() 메소드를 호출

FileChannel getChannel()

FileInputStream의 유일한 FileChannel 객체를 반환

FileDescriptor getFD()

FileInputStream에서 실제 파일에 접속에 대한 FileDescriptor 객체를 반환

 

 

반응형