Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RandomAccessFile

Posted on 1998-11-15
4
Medium Priority
?
218 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.
Suggested Courses

610 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