Consider the InputStream with buffer,for example AudioInputStream (i.e.available() return >=0) The inputstream is reading a changing file (a file which is kept downloading from internet and the undownloaded part is packed with zeros).
- When it read to the part that are not downloaded, wait() will be called
- When the part is downloaded, notify() will be called
However, when it is waked up, how to make sure it drops the buffer(the useless zeros) and read again the file?
Thank in advance