I strongly advise against using available() - it can return 0 because the stream is blocked, even though there are still enough bytes to read. It probably won't occur with Files but the API does not guarantee it won't.
The same approach can be used with read() though:
Because read() is guaranteed to return -1 when the end of the stream has been reached, if the very first read() returns -1 the file must be empty.
Don't forget to close your Readers, Writers and Streams! [ September 25, 2008: Message edited by: Rob Prime ]