• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Copying Integer to a file

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


----------------------------------------------------------------------------------------------------
My problem is I am unable to write integer to file, it is using as unicode, Can someone help me with the problem.

Thanks in advance!!
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vaibhav Singhl,

First things first : Welcome to CodeRanch!

When you post codes in your posts, please UseCodeTags. You can still go and edit your post.

Further, I don't really understand why you require all those variables - c,d,e,f,c1,d1 and so on. An array of variables(with a sensible name) would be better.

That said, let's come to your issue. Integer is not being written to file.

I would advice two things:
1) Try to debug the code.
2) Please go through documentation of write(int) method of RandomAccessFile class. There you'll find what exactly it does. Also, documentation would also give you hints about how to write integer to file directly.

I hope this helps.
 
Vaibhav Singhl
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anayonkar for the help,

It would be very helpful if you can help me with writeInt() method. I tried but I am unable to get it work.

 
Vaibhav Singhl
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help it worked though tried differently.



 
Marshal
Posts: 76433
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anayonkar Shivalkar wrote: . . . please UseCodeTags. . . . .

I see you have found the code button. Please don’t post such long lines; they are difficult to read on most screens. And avoid tabs for indentation; use spaces instead.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic