下面列出了怎么用io.netty.channel.PreferHeapByteBufAllocator的API类实例代码及写法,或者点击链接到github查看源代码。
protected LocalChannel(LocalServerChannel parent, LocalChannel peer) {
super(parent);
config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator()));
this.peer = peer;
localAddress = parent.localAddress();
remoteAddress = peer.localAddress();
}
protected VirtualChannel(VirtualServerChannel parent, VirtualClientConnection connection) {
super(parent);
config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator()));
localAddress = parent.localAddress();
remoteAddress = connection.clientAddress();
this.virtualConnection = connection;
}
@Deprecated
public DefaultOioSocketChannelConfig(SocketChannel channel, Socket javaSocket) {
super(channel, javaSocket);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
DefaultOioSocketChannelConfig(OioSocketChannel channel, Socket javaSocket) {
super(channel, javaSocket);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
DefaultOioDatagramChannelConfig(DatagramChannel channel, DatagramSocket javaSocket) {
super(channel, javaSocket);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
@Deprecated
public DefaultOioServerSocketChannelConfig(ServerSocketChannel channel, ServerSocket javaSocket) {
super(channel, javaSocket);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
DefaultOioServerSocketChannelConfig(OioServerSocketChannel channel, ServerSocket javaSocket) {
super(channel, javaSocket);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
public LocalChannel() {
super(null);
config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator()));
}
public LocalServerChannel() {
config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator()));
}
DefaultRxtxChannelConfig(RxtxChannel channel) {
super(channel);
setAllocator(new PreferHeapByteBufAllocator(getAllocator()));
}
public VirtualServerChannel() {
config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator()));
}