⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 onetoone.java

📁 jni java本地接口编程例子原代码,是java调用本地操作系统代码的接口
💻 JAVA
字号:
class C {
    public static native int atol(String str);
}

class Win32 {
    public static native int CreateFile(
        String fileName,          // file name
        int desiredAccess,        // access (read-write) mode 
        int shareMode,            // share mode 
        int[] secAttrs,           // security attributes 
        int creationDistribution, // how to create 
        int flagsAndAttributes,   // file attributes 
        int templateFile);        // file with attr. to copy
}

class OneToOne {
    public static void main(String[] args) {
	System.out.println("atol(\"123\") = " + C.atol("123"));
	System.out.println("Creating a file called TestFile.tst in the current directory...");
	Win32.CreateFile("TestFile.tst",
			 0x40000000, // GENERIC_WRITE
			 0,          // not sharable
			 null,       // no security
			 2,          // CREATE_ALWAYS
			 0x00000080, // FILE_ATTRIBUTE_NORMAL
			 0);         // no template file
    }
    static {
	System.loadLibrary("OneToOne");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -