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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Random access files and null bytes(java)

  • 07-03-2005 11:59pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 1,345 ✭✭✭Squall


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

    Sorted now :)


Advertisement