Hi, Gourav.
You create a buffer of zero length to hold a data. Of course reader cannot put anything in that buffer (arrays are not resizeable in
java). So you output an empty buffer to a client.
Also any read call may fill only part of the buffer due to a multiple reasons. And further calls to read method will read more data.
So, you need to:
1. Allocate buffer of some nonzero length (1024 * 8 bytes, for example).
2. Use a loop to read a portion of the file and then write that portion to the output stream.
You should read the file until end of file is reached. And you should write only a filled portion of the buffer. Read documentation for InputStream.read to see how to treat it's return values.