Java Hex Format formatAsRawHex(int bitStringLength, String hex)

Here you can find the source of formatAsRawHex(int bitStringLength, String hex)

Description

creates a epc-hex representation of a given tag.

License

Open Source License

Parameter

Parameter Description
bitStringLength the length of the bit-string (binary representation).
hex the hex representation of the tag.

Return

the formatted epc-hex representation.

Declaration

public static String formatAsRawHex(int bitStringLength, String hex) 

Method Source Code

//package com.java2s;
/*//from  w ww .  ja v  a2  s . c  om
 * Copyright (C) 2007 ETH Zurich
 *
 * This file is part of Fosstrak (www.fosstrak.org).
 *
 * Fosstrak is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software Foundation.
 *
 * Fosstrak 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Fosstrak; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

public class Main {
    /**
     * creates a epc-hex representation of a given tag.
     * @param bitStringLength the length of the bit-string (binary representation).
     * @param hex the hex representation of the tag.
     * @return the formatted epc-hex representation.
     */
    public static String formatAsRawHex(int bitStringLength, String hex) {
        return String.format("urn:epc:raw:%d.x%s", bitStringLength, hex);
    }
}

Related

  1. FormatAs2CharHexa(byte byValue)
  2. FormatAs4CharHexa(int nValue)
  3. formatAsHex(byte[] bytes)
  4. formatAsHex(long msgId)
  5. formatAsHexUppercase(long msgId)
  6. formatBytes2HexString(byte[] bytes, int offset, int length)
  7. formatByteToPaddedHex(int i, int l)
  8. formatColorInt2HexString(int c)
  9. formatGuidToDashedNotation(String hexValue)