Here you can find the source of toBoolean(byte b)
See RFC2910, http://www.ietf.org/rfc/rfc2910 IPP boolean is defined as SIGNED-BYTE where 0x00 is 'false' and 0x01 is 'true'
Parameter | Description |
---|---|
b | byte |
static public String toBoolean(byte b)
//package com.java2s; /**//w ww . j av a 2s . c o m * Copyright (C) 2008 ITS of ETH Zurich, Switzerland, Sarah Windler Burri * <p> * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) any * later version. * <p> * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * <p> * See the GNU Lesser General Public License for more details. You should have * received a copy of the GNU Lesser General Public License along with this * program; if not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * See RFC2910, http://www.ietf.org/rfc/rfc2910 IPP boolean is defined as * SIGNED-BYTE where 0x00 is 'false' and 0x01 is 'true' * * @param b byte * @return String representation of boolean: i.e. true, false */ static public String toBoolean(byte b) { return (b == 0) ? "false" : "true"; } }