Hi Sunder,
OutputStream os = response.getOutputStream(); is a legal statement since javax.servlet.ServletOutputStream extends java.io.OutputStream.
In the example they use the method os.write() (which comes from OutputStream), so there is no need to use ServletOutputStream. Both are legal, this is just an arbitrary choice I think.
Gabb