Hi I just started my java data structure class this semester and part of my homework is to make a department report. The part where i'm having hard time thinking about is how to read a binary file hoping anyone could give a steer in the right direction to how to read binary files and then inputting that data into a department report. I know how to read the file that makes up the departments which i have shown below. I was thinking if the employee is a binary file would i have to use a DataInputStream?
thanks for the help
im sry let me clarify wat i mean. first i cannot attach the file i need to read because it is a .dat file. So my professor has given me a file called Employee.dat and i need to read it. I need to be able to read the file so the following is defined:
EmployeeID - 3 bytes ASCII
Employee/Contractor Indicator - 1 byte ASCII 'E' for employee, 'C' for contractor
Department Code - 1 byte ASCII
First Name - 20 bytes ASCII blank padded
Last Name - 15 bytes ASCII blank padded
Salary - float single precision
Hire Date - 1 byte binary identifies the month, 1 byte binary identifies the day, 2 bytes binary identifies the year
Vacation Days - 2 bytes signed binary
Training - 1 byte
hope i cleared this up. O and the text i showed in my first post is the departments i need to have Employee.dat inputted into it. The numbers after each department will be its corresponding department code
but i'm also sure that if your professor asked you to solve this, is because solving it is part of your education. asking in forums will get a respone and will for sure make you learn how to do it, but you lose the greater learning that you have when you need to solve something on your own, and I think that this greater learning is that your professor wants you to have.
anyway, good luck.
author and iconoclast