int id;
String strId;
// i2s
strId = String.valueOf(id);
// s2i
id = Integer.valueOf(strId);
byte[] bytes;
String strSrc = "test";
String strDest;
// s2b
bytes = strSrc.getBytes();
// b2s
strDest = new String(bytes);
public byte[] toByteArray() {
byte[] bytes = new byte[mSignature.length]; //private final byte[] mSignature
System.arraycopy(mSignature, 0, bytes, 0, mSignature.length);
return bytes;
}
str1.equals(str2); public class XMLBuilder {
public static String buildXML(PlayerCount player) {
StringBuilder builder = new StringBuilder();
builder.append("<root>");
builder.append("<server>").append(player.getServerName()).append("</server>");
builder.append("<player_count").append(player.getPlayerCount()).append("</player_count>");
builder.append("</root>");
return builder.toString();
}
}