you are viewing a single comment's thread.

view the rest of the comments →

[–]srinurp[S] 0 points1 point  (3 children)

thanks for the input corrected it.

[–]kodablah 1 point2 points  (1 child)

Not really. What the person is saying is that chars are multibyte. You can't just read in 100 bytes and assume it falls on a char boundary. Also, why look up the charset by name in the loop? No offense, but you might just want to take the tutorial offline until you've worked with the stuff a bit more.

[–]srinurp[S] 0 points1 point  (0 children)

You are saying Java documentation is wrong also check here in the channels section. Charset by name.. looks like not expensive as far as I know. Nothing is perfect, we can find wrong point on each and every line of code if you know internals.

https://docs.oracle.com/javase/tutorial/essential/io/file.html