Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > are there lseek/seek, tell, etc. in Java?

Reply
Thread Tools

are there lseek/seek, tell, etc. in Java?

 
 
Gordon Beaton
Guest
Posts: n/a
 
      04-22-2008
On Tue, 22 Apr 2008 08:13:36 -0400, RC wrote:
> I want to do some lseek/seek (like C) first, then it "tell (like C)"
> the position. Then I write in somewhere in myfile


java.io.RandomAccessFile has what you're looking for.

/gordon

--
 
Reply With Quote
 
 
 
 
RC
Guest
Posts: n/a
 
      04-22-2008
When I open a file by

BufferedWriter bw =
new BufferedWriter(new FileWriter(new File("myfile")));

Where myfile is existed, I don't want to over write the
file from top, I want to do some lseek/seek (like C) first,
then it "tell (like C)" the position. Then I write in somewhere
in myfile

I only found append, and write methods in java.io.Writer class

Thank you very much in advance!
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      04-22-2008
On Tue, 22 Apr 2008 08:13:36 -0400, RC <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>I want to do some lseek/seek (like C) first,


You want RandomAccessFile
See http://mindprod.com/applet/fileio.html
for sample code.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
RC
Guest
Posts: n/a
 
      04-22-2008
Roedy Green wrote:

> You want RandomAccessFile

Thanks!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a java.util.Scanner that works in 1.4.2 out there? Danno Java 2 04-26-2006 04:41 AM
Are there any Belkin router users out there? OM UK VOIP 12 10-04-2005 08:32 AM
is there a hardware / driver combination out there the lets win2k connect to the network before login?? christiane kewitz Wireless Networking 1 02-13-2005 01:08 AM
I am getting loads of spam by e-mail.Most of it is not even addressed to me so god knows how I am receiving it. Any ideas . Is there a spam guard available on blueyonder? How do I get it on my system if there is?Cheers GW Geoff/Elaine Computer Support 11 11-16-2004 11:17 PM
Are there any free .pdf writers out there Goonigoogoo Computer Support 5 11-22-2003 03:27 AM



Advertisments