outputStream.write(END_MESSAGE);
} else {
if (String.class.isAssignableFrom(data.getClass())) {
res = res + TYPE_STRING + DELIMITER + data;
} else {
res = res + TYPE_JSON + DELIMITER + new JSON(data).toString();
}
outputStream.write(res.getBytes());
if(isBinary){
outputStream.write(END_MESSAGE);
}