Here you can find the source of timeToBytes(Time t)
public static byte[] timeToBytes(Time t)
//package com.java2s; //License from project: Apache License import java.sql.Time; import java.util.Calendar; public class Main { public static byte[] timeToBytes(Time t) { Calendar cal = Calendar.getInstance(); cal.setTime(t);//from w w w.j a v a 2 s.c o m byte[] b = new byte[8]; b[0] = (byte) 0; b[1] = (byte) (19 & 0xff); b[2] = (byte) (70 & 0xff); b[3] = (byte) (1 & 0xff); b[4] = (byte) (1 & 0xff); b[5] = (byte) (cal.get(Calendar.HOUR) & 0xff); b[6] = (byte) (cal.get(Calendar.MINUTE) & 0xff); b[7] = (byte) (cal.get(Calendar.SECOND) & 0xff); return b; } }