I have build a client-server application and the two are communicating via sockets and streams. My server creates these streams:
this.out = new DataOutputStream(sock.getOutputStream());
this.in = new DataInputStream(sock.getInputStream());
this.bufread = new BufferedReader(newInputStreamReader(sock.getInputStream()));
and then reads from the InputStream like that:
type = this.in.readByte();
String name = this.bufread.readLine();
Lastly the client writes to the OutputStream like this:
DataOutputStream out = new DataOutputStream(MyClient.getOutputStream());
out.writeByte(17);
out.writeBytes("value\n");
I am sending bytes from my client and the server is reading bytes. If I send chars, ints or anything else from the client will it still be read as bytes from the server? Does the specific function used ensure the type of data read?