Thanks Pete,
I have try to debug the code and find that the NullPointerException is most likely incurred by the InputStream and OutputStream, Since I found that when I try to close them , the same error appears, It seems that I have something wrong with the declaration of the In (inputStream)...