资源简介
NativeIO.java 的源文件
代码片段和文件信息
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License Version 2.0 (the
* “License“); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.io.nativeio;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.fs.Hardlink;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.SecureIOUtils.AlreadyExistsException;
import org.apache.hadoop.util.NativeCodeLoader;
import org.apache.hadoop.util.Shell;
import org.apache.hadoop.util.PerformanceAdvisory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import sun.misc.Unsafe;
import com.google.common.annotations.VisibleForTesting;
/**
* JNI wrappers for various native IO-related calls not available in Java. These
* functions should generally be used alongside a fallback to another more
* portable mechanism.
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
public class NativeIO {
public static class POSIX {
// Flags for open() call from bits/fcntl.h
public static final int O_RDONLY = 00;
public static final int O_WRONLY = 01;
public static final int O_RDWR = 02;
public static final int O_CREAT = 0100;
public static final int O_EXCL = 0200;
public static final int O_NOCTTY = 0400;
public static final int O_TRUNC = 01000;
public static final int O_APPEND = 02000;
public static final int O_NONBLOCK = 04000;
public static final int O_SYNC = 010000;
public static final int O_ASYNC = 020000;
public static final int O_FSYNC = O_SYNC;
public static final int O_NDELAY = O_NONBLOCK;
// Flags for posix_fadvise() from bits/fcntl.h
/* No further special treatment. */
public static final int POSIX_FADV_NORMAL = 0;
/* Expect random page references. */
public static final int POSIX_FA
相关资源
- Android NDK实现Binder服务和客户端
- tcnative-1.dll各个版本整合
- DJNative-SWT20111120 java播放器插件最新版
- 1.1.32、1.1.33两个版本的64位tcnative -1
- JNative资源包
- assimp for android
- DJNativeSwing的jar包以及32和64的SWT
- 解决react-native 的 webview 组件不支持
- 解决React-Native的WebView不支持Android选择
- Hands-On Design Patterns with React Native
- Native Hadoop3.2.1 Library 64位编译
- DJNativeSwing组件集含32 64位swt包
- tcnative-1.dll(最新tomcat-native-1.2.21-op
- Android FFmpeg ANativeWindow视频解码播放器
- 在linux环境下通过java代码操作串口,
- react-native项目
- Android实现NFC读卡信息
- DJ NativeSwing开源包
- jnative
- hadoop-2.6.0编译好的64bit的native库
-
Android应用与fr
amework的socket通信 - netty-tcnative-2.0.27.Final-SNAPSHOT-linux-aar
- 教你java和C++的jni编程
- tcnative-1.dll
- NativeIO.java
- mst Android多点触摸屏的native service参考
- lwjgl-platform-2.9.4-nightly-20150209-natives-
- jnativehook 用于Java的全局键盘和鼠标侦
- Native Libs Monitor
- JNI Java本地接口规范官方中文版
评论
共有 条评论