Java Boolean From toBoolean(byte b)

Here you can find the source of toBoolean(byte b)

Description

See RFC2910, http://www.ietf.org/rfc/rfc2910 IPP boolean is defined as SIGNED-BYTE where 0x00 is 'false' and 0x01 is 'true'

License

Open Source License

Parameter

Parameter Description
b byte

Return

String representation of boolean: i.e. true, false

Declaration

static public String toBoolean(byte b) 

Method Source Code

//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";
    }
}

Related

  1. toBoolean(boolean b)
  2. toBoolean(Boolean bool)
  3. toBoolean(Boolean bool)
  4. toBoolean(boolean bool)
  5. toBoolean(Boolean bool, boolean defaultValue)
  6. toBoolean(byte data[], int offset, boolean value)
  7. toBoolean(byte t_logical)
  8. toBoolean(byte[] b)
  9. toBoolean(byte[] byteArray)