Here you can find the source of charToByte(char encodedChar)
private static byte charToByte(char encodedChar)
//package com.java2s; /*/*from w w w . ja v a2 s. co m*/ * Copyright (C) 2007 Unicon, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * 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. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this distribution. It is also available here: * http://www.fsf.org/licensing/licenses/gpl.html * * As a special exception to the terms and conditions of version * 2 of the GPL, you may redistribute this Program in connection * with Free/Libre and Open Source Software ("FLOSS") applications * as described in the GPL FLOSS exception. You should have received * a copy of the text describing the FLOSS exception along with this * distribution. */ public class Main { private static String byteToCharMap = null; private static final char PADDING = '='; private static byte charToByte(char encodedChar) { byte result = 0; // All indexes are less than the size of a byte if (encodedChar != PADDING) result = (byte) (byteToCharMap.indexOf(encodedChar)); return result; } }