Campbell Ritchie wrote:You can read the individual lines as Strings and put them into a List.
johnsoan smith wrote:I appreciate a lot your replies . I know how to read a file in a character set but the problem is that firstly i have to read it in bytes because all my operations are done in byte level . For example i have used one method which generate a random number array of bytes and use it with bytes of the file . So it means i cant change my file class to a string one but what i need is if there is one way to perform the operations of the file in byte and the result to get in the char . Hope i am clear
Carey Brown wrote:
johnsoan smith wrote:I appreciate a lot your replies . I know how to read a file in a character set but the problem is that firstly i have to read it in bytes because all my operations are done in byte level . For example i have used one method which generate a random number array of bytes and use it with bytes of the file . So it means i cant change my file class to a string one but what i need is if there is one way to perform the operations of the file in byte and the result to get in the char . Hope i am clear
Sorry, I can't fathom why you'd mix binary data in with UTF-8 strings. How are you writing this file in the first place? How do you know where the bytes containing chars ends and the random bytes begin?
johnsoan smith wrote:I appreciate a lot your replies . I know how to read a file in a character set but the problem is that firstly i have to read it in bytes because all my operations are done in byte level .
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |