Forums Register Login

Database update problem URLybird

+Pie Number of slices to send: Send
I had a problem with the db-1x2.db while updating the filed "size"(Maximum occupancy) .
4 bytes I can see in the hex editor as 32 20 20 20 for a value 2
when I write it back , it becomes 00 01 34 20 for a value 4
I think it should be 34 20 20 20


I have used
dbFile.writeUTF(new Integer(size).toString()); for writing
and


dbFile.readFully(input);
String str = new String(input, offset, length, "UTF-8"); for reading


Is there any byte alignment thing working here , or going to show some indifferent behavior later ?
+Pie Number of slices to send: Send
Try changing your 4th argument to "US-ASCII" for the read operation. Hope this helps.
keep an eye out for scorpions and black widows. But the tiny ads are safe.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 782 times.
Similar Threads
java.lang.VerifyError:
jsp insert program not working
hashcodes
The max input fields for servlet can handle
in which method shuld i use at the servlet code for request
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:26:57.