Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8594
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: optional operation |
| Date | 2011-10-06 06:47 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <10179923.1102.1317908858001.JavaMail.geo-discussion-forums@prcs9> (permalink) |
| References | (1 earlier) <c_idnaoeDvisCRHTnZ2dnUVZ_rWdnZ2d@earthlink.com> <6745899f-3c13-4d2b-81fb-52975c560a3b@q24g2000vby.googlegroups.com> <j6in1n$fil$1@dont-email.me> <j6inr7$jms$1@dont-email.me> <a1d9260d-6f6f-456c-a49c-ae8a0bfd2c9a@5g2000yqo.googlegroups.com> |
On Wednesday, October 5, 2011 11:46:11 PM UTC-7, bob wrote: PLEASE do not top-post! PLEASE stop embedding TAB characters in your listings! Dude. Really. > Here's what I tried: > > AssetManager am = this.getResources().getAssets(); > > AssetFileDescriptor afd = am.openFd(filename); > FileInputStream fis = afd.createInputStream(); > FileChannel fchan = fis.getChannel(); > ByteBuffer inBuff = ByteBuffer.allocateDirect( 24121*4 ); > int bytesread = fchan.read( inBuff ); > > FloatBuffer floatBuffer = inBuff.asFloatBuffer(); > > float[] floats = new float[ 24121 ]; > floatBuffer.get( floats); > return floats; > > However, I always get a BufferUnderflowException at > floatBuffer.get( floats); > > 10-05 23:37:07.400: ERROR/AndroidRuntime(3570): Caused by: > java.nio.BufferUnderflowException > > For some reason, floatBuffer thinks it has a capacity of 0 after it's > created. > > Any ideas? buffer 'flip()'? -- Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar
optional operation bob <bob@coolgroups.com> - 2011-10-05 09:49 -0700
Re: optional operation Patricia Shanahan <pats@acm.org> - 2011-10-05 10:30 -0700
Re: optional operation bob <bob@coolgroups.com> - 2011-10-05 14:20 -0700
Re: optional operation markspace <-@.> - 2011-10-05 15:51 -0700
Re: optional operation markspace <-@.> - 2011-10-05 16:05 -0700
Re: optional operation bob <bob@coolgroups.com> - 2011-10-05 23:46 -0700
Re: optional operation Lew <lewbloch@gmail.com> - 2011-10-06 06:47 -0700
csiph-web