当前位置: 首页>>代码示例>>Java>>正文


Java AsynchronousByteChannel类代码示例

本文整理汇总了Java中java.nio.channels.AsynchronousByteChannel的典型用法代码示例。如果您正苦于以下问题:Java AsynchronousByteChannel类的具体用法?Java AsynchronousByteChannel怎么用?Java AsynchronousByteChannel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsynchronousByteChannel类属于java.nio.channels包,在下文中一共展示了AsynchronousByteChannel类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInputStream

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
@Override
protected InputStream getInputStream() {
    if (inputStream == null) {
        if (channel instanceof AsynchronousByteChannel) {
            inputStream = new AsynchronousByteChannelInputStream((AsynchronousByteChannel) channel, timeout);
        } else {
            inputStream = Channels.newInputStream((ReadableByteChannel) channel);
        }
    }
    return inputStream;
}
 
开发者ID:yngui,项目名称:jephyr,代码行数:12,代码来源:NioSocketImpl.java

示例2: getOutputStream

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
@Override
protected OutputStream getOutputStream() {
    if (outputStream == null) {
        if (channel instanceof AsynchronousByteChannel) {
            outputStream = new AsynchronousByteChannelOutputStream((AsynchronousByteChannel) channel);
        } else {
            outputStream = Channels.newOutputStream((WritableByteChannel) channel);
        }
    }
    return outputStream;
}
 
开发者ID:yngui,项目名称:jephyr,代码行数:12,代码来源:NioSocketImpl.java

示例3: sendUrgentData

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
@Override
protected void sendUrgentData(int data) throws IOException {
    if (outputStream == null) {
        if (channel instanceof AsynchronousByteChannel) {
            outputStream = new AsynchronousByteChannelOutputStream((AsynchronousByteChannel) channel);
        } else {
            outputStream = Channels.newOutputStream((WritableByteChannel) channel);
        }
    }
    outputStream.write(data);
    outputStream.flush();
}
 
开发者ID:yngui,项目名称:jephyr,代码行数:13,代码来源:NioSocketImpl.java

示例4: adapt

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
public static CompletableAsynchronousByteChannel adapt(AsynchronousByteChannel original) {
    if (original instanceof CompletableAsynchronousByteChannel) {
        return (CompletableAsynchronousByteChannel)original;
    }
    return new Adapter(original);
}
 
开发者ID:vsilaev,项目名称:tascalate-async-await,代码行数:7,代码来源:CompletableAsynchronousByteChannel.java

示例5: Adapter

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
private Adapter(AsynchronousByteChannel delegate) {
    this.delegate = delegate;
}
 
开发者ID:vsilaev,项目名称:tascalate-async-await,代码行数:4,代码来源:CompletableAsynchronousByteChannel.java

示例6: AsynchronousByteChannelInputStream

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
AsynchronousByteChannelInputStream(AsynchronousByteChannel channel, int timeout) {
    this.channel = channel;
    this.timeout = timeout;
}
 
开发者ID:yngui,项目名称:jephyr,代码行数:5,代码来源:NioSocketImpl.java

示例7: AsynchronousByteChannelOutputStream

import java.nio.channels.AsynchronousByteChannel; //导入依赖的package包/类
AsynchronousByteChannelOutputStream(AsynchronousByteChannel channel) {
    this.channel = channel;
}
 
开发者ID:yngui,项目名称:jephyr,代码行数:4,代码来源:NioSocketImpl.java


注:本文中的java.nio.channels.AsynchronousByteChannel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。