Code example for DataOutputStream

Methods: writeByte, writeInt

0
	protected void WritePayload(DataOutputStream writer) throws IOException {
		Calendar rightNow = Calendar.getInstance();
		int time =(int)((rightNow.get(Calendar.ZONE_OFFSET) + 
						 rightNow.get(Calendar.DST_OFFSET) + 
						 new Date().getTime()) / 1000L);
		writer.writeInt(time);
		writer.writeByte(DateFormat.is24HourFormat(BtServer.instance().getContext()) ? 1 : 0);
	} 
 
}