How to read string from printwriter from java server to swift client through stream

hi all  I am new in swift and i want read string from java server to swift client through stream but its giving me -1 here is my server code in java

                        try {
                            out = new PrintWriter(new BufferedWriter(
                                    new OutputStreamWriter(tempClientSocket.getOutputStream())),
                                    true);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                       out.println("hello world");

here is my client code in swift

            let dataCount = data.count
            let bytesWritten = data.withUnsafeBytes { (p: UnsafePointer<UInt8>) -> Int in
                       return streams.outputStream.write(p, maxLength: dataCount)

when i print stream delegate event code outputOpenCompleted: outputHasSpaceAvailable: is printing but no any printi9ng is coming for inputstream

on inputStream.read meassage is like that ** SocketStream read error [0x28173c000]: 1 60** Please please help me as soon as possibloe

How to read string from printwriter from java server to swift client through stream
 
 
Q