Java Binary Encode toBinaryClassName(String fileName)

Here you can find the source of toBinaryClassName(String fileName)

Description

Converts a class's file name to a binary name.

License

Apache License

Parameter

Parameter Description
fileName class file name

Return

class binary name

Declaration

public static String toBinaryClassName(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from  w  ww. j a v a 2s  .co m*/
     * Converts a class's file name to a binary name.
     *
     * @param fileName class file name
     * @return class binary name
     */
    public static String toBinaryClassName(String fileName) {
        if (fileName.startsWith("/")) {
            fileName = fileName.substring(1);
        }
        if (fileName.endsWith(".class")) {
            fileName = fileName.substring(0, fileName.length() - 6);
        }
        fileName = fileName.replace("/", ".");
        return fileName;
    }
}

Related

  1. toBinaryAddress(int index, int maxIndex)
  2. toBinaryArray(int input, int length)
  3. toBinaryArray(int integer, int size)
  4. toBinaryBoolean(boolean source)
  5. toBinaryChar(boolean bit)
  6. toBinaryFromHex(byte ch)
  7. toBinaryID(final String id)
  8. toBinaryIeee754String(long decimal)
  9. toBinaryIntArray(byte[] bytes, int bitOffset, int bitCount)