Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io #12

Open
daehwan2da opened this issue Apr 13, 2024 · 2 comments
Open

java.io #12

daehwan2da opened this issue Apr 13, 2024 · 2 comments

Comments

@daehwan2da
Copy link
Owner

daehwan2da commented Apr 13, 2024

good ref : https://st-lab.tistory.com/41

@daehwan2da
Copy link
Owner Author

daehwan2da commented Apr 13, 2024

BufferedReader, BufferedWriter vs Scanner

InputStream

  • blocking read

BufferedInputStream : FilterInputStream : InputStream

  • buf : byte[]
    • internal buffer array

BufferedReader

생성 방식

Reader abstract class 의 상속 객체

동작 방식

readLine()

문자 행을 읽어들인다. 개행 문자를 기준으로 행의 마무리를 판단한다.

  • 내부적으로 생성되는 오브젝트 및 스코프
    • StringBuilder
    • synchronized

@daehwan2da
Copy link
Owner Author

System.out.println 가 아닌 logging 을 사용해야하는 이유

System.out 은 PrintStream 오브젝트.
PrintStream#println() 은 synchronized block 으로 감싸져있다 -> blocking 되게동작한다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant