Hello mọi người,em có môt thắc mắc muốn hỏi là đối với chức năng lưu 1 file và lấy 1 file ở server thì dùng NIO có thể thay thế hoàn toàn IO không ạ?
Nếu không thì khi nào nên dùng Java IO và khi nào nên dùng Java NIO ạ ?
Em cám ơn!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thằng nio ra đời sau để bổ trợ cho io chứ không phải triệt tiêu em ạ, nên em dùng thằng nào cũng ok hết em nhé, anh thì kết hợp cả 2.
Theo như ý anh nói là có các chức năng thì dùng IO vẫn tốt hơn thằng NIO đúng ko ạ ?
Không em ạ, ý anh là về phần đọc ghi file thì em sử dụng 2 thằng này thay thế cho nhau đc, tuy nhiên java nio có nhiều cái tiện hơn như lớp Paths, Path và Files em ạ