BufferWriter : 효율적으로 메모리를 사용할 수 있음.
두 Writer의 이점을 살릴려면, wrap 하여 객체를 생성한다.
PrintWriter writer = new PrintWriter(
new BufferedWriter (
new FileWriter("somFile.txt")));
Ref: http://stackoverflow.com/questions/1747040/difference-between-java-io-printwriter-and-java-io-bufferedwriter
Writer 에서
print : writer의 wrap function. 위에서 말한대로 system.out.print 처럼 쉽게 쓸 수 있음.
write: 입력할 길이 조정 가능
This method cannot be inherited from the Writer class because it must suppress I/O exceptions.
Ref: http://www.coderanch.com/t/174675/java-Web-Component-SCWCD/certification/print-write-PrintWriter
댓글 없음:
댓글 쓰기