Here you can find the source of toByte(Object value)
public static long toByte(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static long toByte(Object value) { return (value == null || "null".equals(value.toString())) ? 0 : Byte.parseByte(value.toString().trim()); }// w w w . j a v a 2s . c o m public static String toString(Object value) { return value == null || "null".equals(value.toString()) ? "" : value.toString(); } }