• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I am getting error in this code

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic