I don't think it's a good way to get the size with available() function.
http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#available()
It may not be the actual size of InputStream.