Here you can find the source of toBytes(Object objValue)
Parameter | Description |
---|---|
objValue | Object |
public static byte[] toBytes(Object objValue)
//package com.java2s; /*//from w ww . ja va 2 s . c om * Copyright 2005-2020 GreenTube Team All rights reserved. * Support: Huxg * License: CND team license */ public class Main { /** * * * @param objValue Object * * @return long */ public static byte[] toBytes(Object objValue) { if (objValue != null) { if (objValue instanceof byte[]) { return (byte[]) objValue; } else { return objValue.toString().getBytes(); } } else return null; } /** * * * @param objValue Object * * @return String */ public static String toString(Object objValue) { if (objValue != null) return objValue.toString(); else return null; } }