Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I am getting error in this code

 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting " java.io.EOFException " while retriving data from RMS. i have succeded in storing data in RMS(because getRecord() giving 27 value) so i am confirm that error is while retrieving ..,....i dont know why i am getting this error so please give me suggestion to execut following code

Thanks in advance
******* Here is the code ************

public void getDataFromRMS( )
{
System.out.println(".........Rretiving record........................");

byte[] data = new byte[100];
ByteArrayInputStream buff =new ByteArrayInputStream(data);
DataInputStream input=new DataInputStream(buff);

String msg=null;
int value=0;
boolean state=false;

int len=0;

try{
for(int i=1; i<=rs.getNumRecords() ; i++)
{
len = rs.getRecord(i,data,0);
System.out.println("inside for lop:"+len);
//i am getting error in the following code
msg = input.readUTF();
state = input.readBoolean();
value = input.readInt();

buff.reset();

}

System.out.println(""+msg+":"+state+":"+value);
input.close();
buff.close();

}catch(Exception e)
{
System.out.println("error while retreiving data::"+e);
}

************************output*******************************

Running with storage root DefaultColorPhone

.........Rretiving record........................

exe retiving record........................

inside for lop:27

error wile retreiving data::java.io.EOFException
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i GOT the ERROR .....actually code is correct but if i Run with " DefaultColorPhone" i will get " java.io.EOFException " Exception .

i WILL NOT get error if i Run with " DefaultGrayPhone" ..

why this kind of error i am getting...please give me reason if you know this

thanks in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic