Why would it throw exception while reading if default enconding is UTF?Although writeChars(String ) is a valid method in RandomAccessFile, it is not suitable here because you want to read the contents in UTF format later. writeChars will write the String is default encoding and if you try to read it as UTF, it will throw an exception while reading.
About Question enthuware.ocpjp.v7.2.1774 :
Moderator: admin
-
- Posts: 2
- Joined: Fri Oct 30, 2015 8:21 am
- Contact:
About Question enthuware.ocpjp.v7.2.1774 :
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1774 :
It is probably not too clear from the explanation but the point that it is trying to make is that an exception will be thrown if the default encoding is different from UTF8.
HTH,
Paul.
HTH,
Paul.
Who is online
Users browsing this forum: No registered users and 21 guests