Sending data from iOS server to java client

I am new to iOS development. What I want to achieve is create server on iPhone app and receive data in Java client app.
I have successfully created iPhone side server using this library

On java client side, I am receiving data from local host using same port number

InputStream is = socket.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String message = br.readLine();
            System.out.println("Message received from the server : " +message);

I have made connection successfully.
I am tried sending number and text using this code

func sendObject(object: Any, type: UInt32, completion: ((_ success: Bool) -> Void)? = nil) {
            let data = Data.toData(object: object)
            if peerChannel != nil {
                peerChannel?.sendFrame(ofType: type, tag: PTFrameNoTag, withPayload: (data as NSData).createReferencingDispatchData(), callback: { (error) in
            } else {

But I always receive ‘?bplist?’ in java client.
Do I have to convert data from server end? Please help.