SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP 5, SCWCD 5, SCBCD 5
Cathal Mullan wrote:The RandomAccessFile doesn't provide null terminating operations.
write
public void write(int b)
throws IOException
Writes the specified byte to this file. The write starts at the current file pointer.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP 5, SCWCD 5, SCBCD 5
Jonathan Elkharrat wrote:anyway the only thing you actually change when running the program is the customer ID
and there's not null there (it's an 8 digit number, as per assignment)
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP 5, SCWCD 5, SCBCD 5
Jonathan Elkharrat wrote:just updating the deleted flag. (by the way, that's exactly what the hard disk do when you delete a file
)
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Cathal Mullan wrote:I set the deleted record to invalid just
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP 5, SCWCD 5, SCBCD 5
SCJP 5, SCWCD 5, SCBCD 5
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Cathal Mullan wrote:Yeah I update the contents of the file depending on the operation that is called. I have to worry about null terminated values because I am fully implementing the interface methods.
Cathal Mullan wrote:
So you use a HashMap for the records & are writing them all to the file at once when you shutdown your DB?
If so what if the server crashed, you'd loose all the changes since it started?
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Cathal Mullan wrote:
my URLyBird spec says that values inserted into the DB should be null terminated if they are shorter than the maximum length.
Cathal Mullan wrote:
I have found that the data stored in the DB is not null terminated.
SCJP, SCWCD, SCJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
The company's IT department has a data file that contains the essential information for the company, but because the data must continue to be manipulated for reports using another custom-written application, the new system must re-implement the database code from scratch without altering the data file format.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roel De Nijs wrote:If I think back to my Applied Informatics education (almost 10 years ago, I'm getting old) I know a string in C was null-terminated. I guess this "null-terminated" thing is a left-over in the analysis (instructions) of a previous program (maybe written in C) and the main purpose of keeping this sentence in the instructions is nothing more than confusing you a bit (I think)
![]()
Because the given database file contains space-padded values, I padded values with spaces and just ignored this null-terminated thing (but of course documented this decision in choices.txt)
SCJP 5, SCWCD 5, SCBCD 5
Jonathan Elkharrat wrote:try and guess the result of the following: (just to remind you '\0' = null)
SCJP 5, SCWCD 5, SCBCD 5
SCJP 5, SCWCD 5, SCBCD 5
SCJP 5, SCWCD 5, SCBCD 5
sachin verma wrote:Don't use IDE to run these type of program.
Run on command line and see the output.
It is a bug in JCreator.I don't know about other IDE
[ May 07, 2008: Message edited by: sachin verma ]
SCJP 5, SCWCD 5, SCBCD 5
Jonathan Elkharrat wrote:try with the '\u0000' instead of '\0' and tell me the result.
Don't touch me. And dont' touch this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|