Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

John Martin

Greenhorn
+ Follow
since Aug 09, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Martin

Note: My output is now 'normal'. I am not sure what the problem was. The original file may have been corrupted? Not sure.

Thanks for the insights!
Note: I do see that this has been a recurring question over that past few years.
Hey All - Thanks!

I found some old code Andrew had posted. 'Search' feature came thru on my first question.

Basically just cast each long value you readin for the field name:

//using dataInputStream
byte[] fldName = new byte[fldSz];
long fldNameValue = dis.read(fldName);
String fieldName = (new String(fldName))


However I am still getting too largge a value for the Number of Fields:




Output:

cookie = 538968322
# fields 8199.

I dont think the evaluator will allow me to hard code a 7 for # fields!


Thx for any ideas.
I am using a DataInputStream to read the database file. However, I am confused at how to read String values as there are no methods listed. The readUTF() (which does return a String) did not function properly.

A reference guide suggests using a ObjectInputStream, but that class has the same methods as DataInputStream.

Also, when reading the 2 byte vlaue for number of fields for each record I received a large value.
Andrew, the book looks fantastic! Congrats! I will order it and move to 1.5.x.
We can safely use 1.4.2, correct?

The requirements said any release no more than 18 months old. So this would mean that sdk 1.4.2 is valid thru next summer.
UML is not a stated req. Better to keep it simple.

I am using Trottier's Exam Cram : Java 2.

There have been a few complaints in re: the LockManager example used in the book. But, so far, it provides some solid foundations to begin with. One being, go to JavaRanch.com.