简体   繁体   English

Netty本地文件通道实现

[英]Netty local filechannel implementation

I'm working on a project where we need to encode/decode files locally. 我正在一个项目中,我们需要在本地对文件进行编码/解码。 Our team decided to use netty because the project may be extended to send/receive data via sockets and handlers are easy to use (writing one handler per codec looked like a good idea). 我们的团队决定使用netty,因为该项目可以扩展为通过套接字发送/接收数据,并且处理程序易于使用(每个编解码器编写一个处理程序看起来是个好主意)。 For now the the idea is to read/write files locally. 现在的想法是在本地读取/写入文件。 But I couldn't find any channel implementation which would work on files instead of sockets. 但是我找不到任何适用于文件而不是套接字的通道实现。 Is there any channel for this job or should I just implement it myself? 这个工作有什么渠道吗?还是我应该自己实施?

The closest channel I could use was localchannel but that wouldn't work because it uses queue and writes directly to peer's queue (even thought there are no sockets, this class works locally and just simulates how sockets would work). 我可以使用的最接近的通道是localchannel,但是它不起作用,因为它使用队列并直接写入对等方的队列(即使认为没有套接字,该类在本地也可以工作,并且只是模拟套接字的工作方式)。

I'd like to know if there is an implementation of this kind of channel for netty. 我想知道是否存在这种用于Netty的渠道。 Or some pointers about how it can be implemented. 或有关如何实现它的一些指示。

Netty中不包含任何此类内容,因此您需要自己实施

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM