Java 8 FileDescriptor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 FileDescriptor class.

This code example shows how to use the following methods:
     * Constructor 
     */ 
    public ServerSocketChannelImpl(SelectorProvider sp) throws IOException {
        super(sp);
        status = SERVER_STATUS_OPEN;
        fd = new FileDescriptor();
        Platform.getNetworkSystem().createStreamSocket(fd,
                NetUtil.preferIPv4Stack()); 
        impl = new PlainServerSocketImpl(fd);
        socket = new ServerSocketAdapter(impl, this);
    } 
     
    // for native call 
    @SuppressWarnings("unused") 
    private ServerSocketChannelImpl() throws IOException { 
        super(SelectorProvider.provider());
        status = SERVER_STATUS_OPEN;
        fd = new FileDescriptor();
        impl = new PlainServerSocketImpl(fd);
        socket = new ServerSocketAdapter(impl, this);
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getInt$
        command.append(" /system/bin/app_process /system/bin --application");
        if (niceName != null) {
            command.append(" '--nice-name=").append(niceName).append("'");
        } 
        command.append(" com.android.internal.os.WrapperInit ");
        command.append(pipeFd != null ? pipeFd.getInt$() : 0);
        command.append(' ');
        command.append(targetSdkVersion);
        Zygote.appendQuotedShellArgs(command, args);
        Zygote.execShell(command.toString());
    } 
 
    /** 
     * Executes a standalone application with a wrapper command. 
     * This method never returns. 
     * 
     * @param invokeWith The wrapper command. 
     * @param classPath The class path. 
     * @param className The class name to invoke. 
     * @param args Arguments for the main() method of the specified class. 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
    @Override public SourceChannel source() {
        return source;
    } 
 
    /** 
     * FileChannelImpl doesn't close its fd itself; it calls close on the object it's given. 
     */ 
    private static class FdCloser implements Closeable {
        private final FileDescriptor fd;
        private FdCloser(FileDescriptor fd) {
            this.fd = fd;
        } 
        public void close() throws IOException { 
            IoUtils.close(fd);
        } 
    } 
 
    private class PipeSourceChannel extends Pipe.SourceChannel implements FileDescriptorHandler {
        private final FileDescriptor fd;
        private final FileChannelImpl channel;

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
    /** 
     * Returns a new FileDescriptor whose internal integer is set to 'fd'. 
     */ 
    public static FileDescriptor newFileDescriptor(int fd) {
        FileDescriptor result = new FileDescriptor();
        setFd(result, fd);
        return result;
    } 
 
    /** 
     * Creates a pipe by calling pipe(2), returning the two file descriptors in 
     * elements 0 and 1 of the array 'fds'. fds[0] is the read end of the pipe. 
     * fds[1] is the write end of the pipe. Throws an appropriate IOException on failure. 
     */ 
    public static native void pipe(int[] fds) throws IOException;
 
    /** 
     * Sets the int file descriptor within the given FileDescriptor 'fd' to 'newValue'. 
     */ 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getInt$
    private void unTagSocketFd(FileDescriptor fd) {
        final SocketTags options = threadSocketTags.get();
        if (options.statsTag == -1 && options.statsUid == -1) return;
 
        if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) {
            final int errno = native_untagSocketFd(fd);
            if (errno < 0) {
                Log.w(TAG, "untagSocket(" + fd.getInt$() + ") failed with errno " + errno);
            } 
        } 
    } 
 
    public static class SocketTags { 
        public int statsTag = -1;
        public int statsUid = -1;
    } 
 
    public static void setKernelCounterSet(int uid, int counterSet) {
        if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) {
            final int errno = native_setCounterSet(counterSet, uid);
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 FileDescriptor Questions & Answers:

See Code Examples for Java 8 FileDescriptor Methods: