This is possible to do for some value of "possible".
String s = "" + (char)myShort;
However, the resulting string may be invalid as not all 16-bit integers represent valid (UTF-16 encoded) code-points! That is, the resulting string may be an invalid UTF-16 sequence. Various string functions and/or encoding/decode may result in "strange behavior" as the fundamental rules have been violated (I think it is somewhat lax as to what may occur, but...). You have been warned -- see the bottom example showing just one possible manifestation.
tl,dr. Don't use strings for this sort of network transmission*. Rather, use byte arrays (or ByteBuffers) and send the short as two octets, high and low. (Oh, and did I mention ByteBuffers? Take a look at the methods...) If strings need to be sent they can be encoded (UTF-8) and also sent as "bytes" in the data packets.
Of course, it is quite likely be simpler just to use standard Serialization or Protocol buffers to deal with the packets... sure beats custom encoding. (Also, protocol buffers does some neat tricks like zig-zag integer encoding...)
Happy coding :)
*Although, Quake 3 use strings for a number of network messages ... however, it encoded the values "as plain text" -- e.g. "xyz=1234" -- and used a bunch of monkey hand-serialization code.
See the last value in the output as to why this "string stuffing" can be bad stuff ;-)
public class test1 {
public static void main (String[] args) throws Exception {
int s1 = 0xd801;
short s = (short)s1;
String x = "" + (char)s;
System.out.println("orig int: " + s1);
System.out.println("orig short: " + s);
System.out.println("length of string: " + x.length());
System.out.println("value in string: " + (short)x.codePointAt(0));
int s2 = ((short)x.codePointAt(0)) & 0xffff;
System.out.println("restored value: " + s2);
byte[] xb = x.getBytes("UTF8");
System.out.println("encoded size: " + xb.length);
String x2 = new String(xb, "UTF8");
System.out.println("decode:" + x2);
System.out.println("decode length:" + x2.length());
int s3 = ((short)x2.codePointAt(0)) & 0xffff;
System.out.println("value in string:" + s3);
}
}
The results in JDK 7, Windows 64.
orig int: 55297
orig short: -10239
length of string: 1
value in string: -10239
restored value: 55297
encoded size: 1
decode:?
decode length:1
value in string:63 WHAT IS THIS?!?!?! NOOOOO!!!!!