Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8573

Re: DataInputStream

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!postnews.google.com!n8g2000yqd.googlegroups.com!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: DataInputStream
Date Wed, 5 Oct 2011 08:58:44 -0700 (PDT)
Organization http://groups.google.com
Lines 28
Message-ID <64b13101-4846-42d7-bc75-458eb326f73f@n8g2000yqd.googlegroups.com> (permalink)
References <1418dd7f-d5d1-4a2c-b77b-87666f6a9591@k15g2000yqd.googlegroups.com> <9f2a8cFh1nU1@mid.individual.net> <6cf66421-77a9-4088-b810-3bcc958cc8ca@i28g2000yqn.googlegroups.com> <2ec7550a-a3d9-40a9-bca1-e1fd2586429d@g33g2000yqc.googlegroups.com> <02b9b80f-ff02-499d-8f33-056080b114bb@s9g2000yql.googlegroups.com>
NNTP-Posting-Host 193.0.246.21
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1317830414 22166 127.0.0.1 (5 Oct 2011 16:00:14 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 5 Oct 2011 16:00:14 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info n8g2000yqd.googlegroups.com; posting-host=193.0.246.21; posting-account=MGO7qgoAAABvyo26eHVDO00044spH-ws
User-Agent G2/1.0
X-HTTP-Via 1.1 webwasher (Webwasher 6.8.7.9396)
X-Google-Web-Client true
X-Google-Header-Order ASELNKCHRUV
X-HTTP-UserAgent Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8573

Show key headers only | View raw


On Oct 5, 4:17 pm, bob <b...@coolgroups.com> wrote:
> The issue is that it's too slow.

Ah, now we're getting closer to the point.  I'd first test whether the
slowness is caused by the underlying stream or the reading procedure.
If it's the stream (e.g. because you read unbuffered from a socket)
then you might want to add buffering or you need a faster NIC.  If
it's in the reading then look at Mark's suggestion.

> What I'm hoping for is something like this:
>
>                         byte[] b = new byte[numfloats*4];
>                         dis.read(b, 0, numfloats*4);
>                         float[] f = (float[]) b;
>                         return f;
>
> I don't know why, but it won't let me do the cast.  Any ideas?

See Patricia's reply.  Java works fundamentally different from C or C+
+.  For example, there are no pointers into memory.  I seriously
suggest you make yourself familiar with the language and the JVM.

Kind regards

robert

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

DataInputStream bob <bob@coolgroups.com> - 2011-10-04 22:34 -0700
  Re: DataInputStream Robert Klemme <shortcutter@googlemail.com> - 2011-10-05 08:02 +0200
    Re: DataInputStream bob <bob@coolgroups.com> - 2011-10-04 23:17 -0700
      Re: DataInputStream Robert Klemme <shortcutter@googlemail.com> - 2011-10-05 00:07 -0700
        Re: DataInputStream bob <bob@coolgroups.com> - 2011-10-05 07:17 -0700
          Re: DataInputStream markspace <-@.> - 2011-10-05 08:27 -0700
          Re: DataInputStream Patricia Shanahan <pats@acm.org> - 2011-10-05 08:38 -0700
          Re: DataInputStream Robert Klemme <shortcutter@googlemail.com> - 2011-10-05 08:58 -0700
            Re: DataInputStream Lew <lewbloch@gmail.com> - 2011-10-05 14:52 -0700
              Re: DataInputStream Patricia Shanahan <pats@acm.org> - 2011-10-05 15:15 -0700
              Re: DataInputStream Robert Klemme <shortcutter@googlemail.com> - 2011-10-06 00:11 -0700
                Re: DataInputStream Lew <lewbloch@gmail.com> - 2011-10-06 07:08 -0700
                Re: DataInputStream Patricia Shanahan <pats@acm.org> - 2011-10-06 07:49 -0700
          Re: DataInputStream Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-05 21:16 -0400
      Re: DataInputStream Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-10-05 08:12 +0000
        Re: DataInputStream bob <bob@coolgroups.com> - 2011-10-05 07:12 -0700
  Re: DataInputStream Roedy Green <see_website@mindprod.com.invalid> - 2011-10-06 02:48 -0700

csiph-web