?
Solved

RandomAccessFile

Posted on 1998-11-15
4
Medium Priority
?
217 Views
Last Modified: 2012-06-21

For RandomAccessFile, there is a writeUTF() method.  Is there just a plain writeString() or writeln() method, or a way to implement such a thing using RandomAccessFile (I like the ability to both read and write and append using the same stream, but in this case I just want to work with text files)?  There is a writeChars(), but it writes a string of chars, with a space between each, so it isn't quite what I'm looking for.

Thanks for any help!


ap9
0
Comment
Question by:ap9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Expert Comment

by:vendrig
ID: 1227487
Try writeBytes. A weird name, but you can give a String value for parameter and it's written as a string to file (so you can read it in your ASCII editor). Use "\n" for new line.
0
 

Author Comment

by:ap9
ID: 1227488
Works great!  How can I credit you?  Can you repost that as an answer?


AP9
0
 
LVL 2

Accepted Solution

by:
vendrig earned 160 total points
ID: 1227489
Comment reposted as answer:
Try writeBytes. A weird name, but you can give a String value for parameter and it's written as a string to file (so you can read it in your ASCII editor). Use "\n" for new line.
0
 
LVL 2

Expert Comment

by:vendrig
ID: 1227490
Yeah, the name is real confusing. It took me some time to find that function ("but I don't want to write bytes, I want to write strings!";-) Good luck with it.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question