Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10411
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Roedy Green <see_website@mindprod.com.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Writing to file |
| Date | Fri, 02 Dec 2011 01:33:50 -0800 |
| Organization | Canadian Mind Products |
| Lines | 28 |
| Message-ID | <im6hd71hha4eorbj4rmoj7ghjgvt595nni@4ax.com> (permalink) |
| References | <e1b7d157-4018-44a7-8176-3a2f308562b8@cu3g2000vbb.googlegroups.com> |
| Reply-To | Roedy Green <see_website@mindprod.com.invalid> |
| NNTP-Posting-Host | Z2l1DcCELS0rATq8NqV4Sw.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| X-Newsreader | Forte Agent 6.00/32.1186 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10411 |
Show key headers only | View raw
On Wed, 30 Nov 2011 11:31:33 -0800 (PST), sara <sarasara82@gmail.com>
wrote, quoted or indirectly quoted someone who said :
>DataOutputStream dos = new DataOutputStream(fos);
>for (n : N) {
>dos.writeInt(n.id);
>dos.writeFloat(x.floatValue());
See http://mindprod.com/applet/fileio.html
It will generate you code to do this. Make sure you ask for buffered
if you want speed.
Get rid of Float objects and just use pure float primitives if you
want speed.
There is not much overhead, just flipping the little endian Intel uses
internally to big endian.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Writing to file sara <sarasara82@gmail.com> - 2011-11-30 11:31 -0800 Re: Writing to file Lew <lewbloch@gmail.com> - 2011-11-30 14:20 -0800 Re: Writing to file Roedy Green <see_website@mindprod.com.invalid> - 2011-12-02 01:33 -0800 Re: Writing to file Arne Vajhøj <arne@vajhoej.dk> - 2011-12-02 19:58 -0500
csiph-web