File file = new File("파일 또는 디렉토리의 경로.") public static void main(String[] args) {
File f = new File("dog.jpg");
System.out.println(f.exists()); // true
System.out.println(f.isFile());
System.out.println(f.isAbsolute()); // false
System.out.println(f.getAbsolutePath()); //C:\Users\SSAFY\eclipse-workspace\Day10\dog.jpg
System.out.println(f.length() + "bytes.");
// 파일 뿐만 아니라, 폴더도 적용할 수 있다.
File src = new File("src");
System.out.println(src.exists());
System.out.println(src.isDirectory());
File folder = new File("Forder");
System.out.println(folder.exists());
System.out.println(folder.mkdir()); // 폴더를 만들어서 boolean 출력
}
데이터 타입에 따른 스트림의 분류

inputStream, OutputSteam
inputStream 클래스
int read() throws IOException int read(byte[] b) throws IOException int read(byte[] b, int off, int len) throws IOExceptionvoid close() throws IOExceptionOutputStream 클래스
void write(int b) throws IOException void write(byte[] b) throws IOException void write(byte[] b, int off, int len) throws IOException public void flush() public void close() 


Reader 클래스
int read() throws IOException int read(char[] cbuf) throws IOException int read(char[] cbuf, int off, int len) throws IOExceptionvoid close() throws IOExceptionWriter 클래스
void write(int b) throws IOException void write(char[] cbuf) throws IOException void write(char[] cbuf, int off, int len) throws IOException void write(String str) throws IOException void write(String str, int off, int len) throws IOException public void flush() public void close() 