sun.nio.ch.SimpleAsynchronousFileChannelImpl Java Examples

The following examples show how to use sun.nio.ch.SimpleAsynchronousFileChannelImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnixChannelFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #2
Source File: UnixChannelFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #3
Source File: UnixChannelFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #4
Source File: UnixChannelFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #5
Source File: UnixChannelFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #6
Source File: UnixChannelFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #7
Source File: UnixChannelFactory.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #8
Source File: UnixChannelFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #9
Source File: UnixChannelFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #10
Source File: UnixChannelFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #11
Source File: UnixChannelFactory.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #12
Source File: UnixChannelFactory.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}
 
Example #13
Source File: UnixChannelFactory.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an asynchronous file channel by opening the given file.
 */
static AsynchronousFileChannel newAsynchronousFileChannel(UnixPath path,
                                                          Set<? extends OpenOption> options,
                                                          int mode,
                                                          ThreadPool pool)
    throws UnixException
{
    Flags flags = Flags.toFlags(options);

    // default is reading
    if (!flags.read && !flags.write) {
        flags.read = true;
    }

    // validation
    if (flags.append)
        throw new UnsupportedOperationException("APPEND not allowed");

    // for now use simple implementation
    FileDescriptor fdObj = open(-1, path, null, flags, mode);
    return SimpleAsynchronousFileChannelImpl.open(fdObj, flags.read, flags.write, pool);
}