Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Random access files and null bytes(java)

Options
  • 08-03-2005 12:59am
    #1
    Registered Users Posts: 1,345 ✭✭✭


    Im reading from a random access file in java using the readLine() method.

    Its outputting with null bytes

    Any way of removing these from the string?

    I used the .replace ( author = new String(author).replace( '\0',' '); ) method to replace them with spaces, but then im just left with a string full of spaces.

    I considered removing the spaces, but I want to retain the actual spaces in the string, ie where the break was intended.

    I think my brains just fried, would appreciate any suggestions


Comments

  • Registered Users Posts: 1,345 ✭✭✭Squall


    Should have been using the writeBytes() method not writeChar()

    Sorted now :)


Advertisement