Java Formatter Usage GetRawView(String string)

Here you can find the source of GetRawView(String string)

Description

Get Raw View

License

Open Source License

Declaration

public static String GetRawView(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Formatter;

public class Main {
    public static String GetRawView(String string) {
        byte[] bytes = string.getBytes();

        StringBuilder sb = new StringBuilder();

        Formatter formatter = new Formatter();
        for (int i = 0; i < bytes.length; i++) {
            String raw = Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1);
            sb.append(raw.toUpperCase());

            if (i != (bytes.length - 1)) {
                sb.append("-");
            }/*ww  w.  j av a2s .  c  o m*/
        }

        return sb.toString();
    }
}

Related

  1. fperfdata(String label, double val, String uom, int warnp, double warn, int critp, double crit, boolean minp, double minv, boolean maxp, double maxv)
  2. generateMacOnIncrease(final String baseMac, final long l)
  3. getCommitCounterStr(final long commitCounter)
  4. getFormatedTime(double timeInSeconds)
  5. getPropertiesString(Properties myProps)
  6. getRoundedString(double value, int powerOf10)
  7. incrementAlpha(String suppliedPrefix, String lastNumber, int numberLength)
  8. listToString(List list, String separator)
  9. long2Mac(final long macAddress)