This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

Interpertation for B&S

 
GD Deepz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
readInt() --- > will get you the magic cookie from start of file
readInt() --- > again will get you the record length in bytes start of file
readShort() ---> will return the number of fields start of file

BUT how do you get the length of bytes for each field "name" and the field length in bytes.

According to my spec from B&S:

Repeated for each field in a record
2 byte numeric, length in bytes of field name
n bytes(defined by previous entry), field name
2 byte numeric, field length in bytes
end of repeating block

I am confused by the above spec, how do I determine the above, any suggestion on the code would help
--------------------------------------------------------------------------------
 
Matt Sheehan.
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
readInt() --- > will get you the magic cookie from start of file
readInt() --- > again will get you the record length in bytes start of file
readShort() ---> will return the number of fields start of file


next:
n0 = readShort() ---> length in bytes of field name 0
read(for n0 bytes) ---> field name 0
readShort() ---> length in bytes of field 0
n1 = readShort() ---> length in bytes of field name 1
.
.
.
 
GD Deepz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Matt but please clarify.
readInt() --- > will get you the magic cookie from start of file
readInt() --- > again will get you the record length in bytes start of file
readShort() ---> will return the number of fields start of file
--------------------------------------------------------------------------------

Please clarify

next:
n0 = readShort() ---> length in bytes of field name 0 // UNDERSTOOD
read(for n0 bytes) ---> field name 0 //Is this read() only.
readShort() ---> length in bytes of field 0 //understood
n1 = readShort() ---> length in bytes of field name 1 //understood
.

Thanks Matt






The following is your code
 
Matt Sheehan.
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read(for n0 bytes) ---> field name 0 //Is this read() only.

If you are using a RandomAccessFile, you do this by:

Is this what you're asking?

Matt
[ October 08, 2004: Message edited by: Matt Sheehan. ]
 
GD Deepz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go it and thanks Matt, have you completed your SCJD?
 
Matt Sheehan.
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go it and thanks Matt, have you completed your SCJD?

I wish! I'm getting close, though.

Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic