Questions tagged [bufferunderflowexception]

A BufferUnderflowException is thrown when elements are read from a buffer but there are not enough elements remaining in the buffer.

A BufferUnderflowException is thrown when elements are read from a buffer but there are not enough elements remaining in the buffer or say when the buffer is already empty.

15 questions
10
votes
2 answers

Bufferunderflowexception Java

I am writing values to a file. The values are written correct. In another application I can read the file without any exceptions. But in my new application, I get a Bufferunderflowexception when trying to read the file. The bufferunderflowexception…
Swag
  • 2,090
  • 9
  • 33
  • 63
5
votes
3 answers

Why do I get a java.nio.BufferUnderflowException in this Scala

I was trying to do some scripting in Scala, to process some log files: scala> import io.Source import io.Source scala> import java.io.File import java.io.File scala> val f = new File(".") f: java.io.File = . scala> for (l <- f.listFiles) { | …
thatismatt
  • 9,832
  • 10
  • 42
  • 54
4
votes
2 answers

JavaEE + Glassfish - BufferUnderflowException

I have a very simple Java EE application with some beans that use JMS to communicate. When I try to deploy and debug my application, I get this Informazioni: visiting unvisited references Grave: Unknow type constant pool 18 at position38 Grave: …
3
votes
2 answers

BufferUnderflowException? Here?

I am writing a small UDP server in Java. When the server receives a command ('GET_VIDEO'), he reads a file ('video.raw') and then sends it to the client. Here is my code : public class ServeurBouchon { /** * @param args */ …
Dimitri
  • 8,122
  • 19
  • 71
  • 128
3
votes
1 answer

java.nio.BufferUnderflowException when processing files in Scala

I got a similar problem to this guy while processing 4MB log file. Actually I'm processing multiple files simultaneously but since I keep getting this exception, I decide to just test it for a single file: val temp =…
Ekkmanz
  • 472
  • 1
  • 5
  • 15
2
votes
4 answers

How to convert a byte array to two long values?

I'm reading a 16 byte array (byte[16]) from a JDBC ResultSet with rs.getBytes("id") and now I need to convert it to two long values. How can I do that? This is the code I have tried, but I probably didn't use ByteBuffer correctly. byte[] bytes =…
Jonas
  • 121,568
  • 97
  • 310
  • 388
2
votes
1 answer

android: BufferUnderflowException while rendering pdf

I am trying to implement a program to read pdf file but when I am doing so I am not able to show the pages in first time and in second time its showing few pages with overlapping words.I dont understand what is wrong Could anyone suggest me what to…
poojagupta
  • 982
  • 2
  • 12
  • 26
1
vote
0 answers

Android NIO- Not able to read large data from SocketChannel, Error: BUFFER_UNDERFLOW

We are trying to read large amount of data through NIO TCPs SocketChannel. Code is working for small amount of data(less than 16KB), but above than first it read 16KB into destination buffer again try to read for remaining data it gives…
1
vote
1 answer

ByteBuffer causing underflow exception

I came across a problem when sending data over TCP with a custom protocol which relies on knowing the length of data so I decided that I could not send an int due to the size of the int could be different lengths (the int 10 has a length of 2…
user3045798
  • 183
  • 1
  • 3
  • 11
1
vote
0 answers

libgdx-html5 : texture dispose generate a bufferunderflowexception

I'm developping games with LIBGDX on ANDROID. Today, i've tried to generate one of my project in a HTML5 version. I put the content of the WAR folder on my server. All is fine except 2 things. I'll present you here just one of these 2 issues. The…
1
vote
3 answers

Buffer Underflow?

I have the following snippet of code. The marked line is causing a BufferUnderflowException. I read the documentation on the exception but still do not understand what exactly it menas. I use the .rewind() method which I was under the impression…
KDEx
  • 3,505
  • 4
  • 31
  • 39
0
votes
2 answers

Underflow Exception error in java

I am creating a AvlTree program. I am trying to implement a UnderflowException class within my code but it seems not to work. Shouldn't be possible? or I'm doing something wrong. My code: public class AvlTree
0
votes
1 answer

Why do I take java.nio.BufferUnderflowException

I take BufferUnderflowException from following code. int length = mBuf.remaining(); char[] charBuff = new char[length]; for (int i = 0; i < length; ++i) { char[i] = mBuf.getChar(); } mBuf is a ByteBuffer. Line "char[i] =mBuf.getChar();" is…
mcnull
  • 39
  • 9
0
votes
1 answer

Send long over UDP multicast

I'm trying to send a long over a multicast. The connection should work, because it's possible to send a String. This is my serverside code: currentServerStatusId = Server.getServerStatusVersionId(); buf =…
dumazy
  • 13,857
  • 12
  • 66
  • 113
0
votes
1 answer

Problems to display pdf in PagePanel

I'm having trouble viewing a page in PagePanel, when trying to display the pdf, error occurs "java.nio.BufferUnderflowException." Error: java.nio.BufferUnderflowException at java.nio.HeapByteBuffer.get(Unknown Source) at…