|
Java原始碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的Java詞法解析引擎全面地分析您的原始碼並根據用戶自定義的Java語言程式碼風格重構和美化Java原始碼檔案,因此它能精細地根據不同的原始碼風格美化多種原始碼,甚至是下面這些極度混亂的原始碼:
|
Java原始碼美化範例:
範例1
|
範例2
|
範例3
|
範例4
這是一個非常極端的 Java 原始碼美化的範例,其目的是為了展示 SourceFormatX Java原始碼美化工具詞法解析引擎的威力。這份混亂到無法閱讀的 Java 程式碼檔案在1秒種內即被 SourceFormatX 美化和縮排成整潔且可讀性強的美觀風格樣式。
package cryptix.examples;import java.io.FileInputStream;import
java.io.IOException;import cryptix.security.MD5;
/** This is a demo of how to use the MD5 or SHA1 classes for hashing data **/
public final class MD5AFile{private static final int BUF_LENGTH=1024;public
static void main(String argv[]){if(argv.length!=1)System.err.println(
"usage java MD5Afile filename");else try{printHash(doHash(argv[0]));}catch(
IOException ioe){System.err.println(
"There has been an IO exception to the file was not hashed.");
ioe.printStackTrace();}}private static void printHash(byte buf[]){
System.out.println("hash of file is;");System.out.print("MD5 : ");for(int i=0,j
=buf.length;j>0;i++,j--){int val=(int)buf[i];System.out.print(Integer.toString(
(val>>4)&0xF,16));System.out.print(Integer.toString(val&0xF,16));}
System.out.println();}}
package cryptix.examples;
import java.io.FileInputStream;
import java.io.IOException;
import cryptix.security.MD5;
/** This is a demo of how to use the MD5 or SHA1 classes for hashing data **/
public final class MD5AFile
{
private static final int BUF_LENGTH = 1024;
public static void main(String argv[])
{
if (argv.length != 1)
System.err.println("usage java MD5Afile filename");
else
try
{
printHash(doHash(argv[0]));
}
catch (IOException ioe)
{
System.err.println(
"There has been an IO exception to the file was not hashed.");
ioe.printStackTrace();
}
}
private static void printHash(byte buf[])
{
System.out.println("hash of file is;");
System.out.print("MD5 : ");
for (int i = 0, j = buf.length; j > 0; i++, j--)
{
int val = (int)buf[i];
System.out.print(Integer.toString((val >> 4) & 0xF, 16));
System.out.print(Integer.toString(val & 0xF, 16));
}
System.out.println();
}
}
範例1
|
範例2
|
範例3
|
範例4
|