Following is the code that i wrote to practice I/O. i waned to write the array b in the file, then reset the pointer to the beginning of the output file so that i cd overwrite stuff from the input file (test.txt)
a. i get a compile time error saying that the reset method not found in FileOutputStream class. b. when i extend the OutputStream class to use the reset()method, it says in have to provide an implementation for the read() method. question: all i want to do is to reset the pointer in my output file after writing the araay b. how can i do it??
The reset method is provided in certain InputStream methods that have a buffer of characters or bytes. The method is there so that you can mark a point in the input stream, read some data, and then reset the stream to the marked point. Naturally the amount of data you can read is restricted by the buffer size.
Robert: if it is like water, then why provide the reset() method? Bill: there has to be more than that...the API documentation mentions mark but also says beginning of file in case there is no last mark found..... am still in the air
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.