|
Seeing so many of you, String is the easiest!
public void save(int n)
{
String s=new String(""+n); //Integer becomes a string.
rs.write(s.getBytes(),0,s.length); //Assuming rs is your Record object
}
public int get(int position)
{
byte[] temp=rs.getRecord(position);
return Integer.parseInt(new String(temp));
} |
|