quiz
quiz copied to clipboard
Refactor the code to make it look more object-oriented and maintainable
- i.read() returns -1 to detect end. - unicode has 2 byte from 0x00 to 0xff but it consist ASCII simbols
Major thing that I found is you are using same file and performing different operations on it using various methods so in this case you must close stream after performing...
Defined magic hex number (0x80) as a constant and used it. Made public methods final to allow a better design and prevent classes overriding the default behaviour. File reading/writing was...
used Java NIO utils.
close input/output streams, code clean up
Also possible to use utility functions from Guava/Apache Commons. Also possible to split the functionality into ReadingParser/WritingParser or something along these lines. Relying on filesystem to handle concurrent file access.
Changed variable name from f to file Added length in saveContent method
1. Added constructor 2. Used BufferedReader & BufferedWriter to increase efficiency for reading and writing . 3. Closed stream objects. 4. Removed unnecessary usage of synchronized. 5. Used BufferedReader for...