diff --git a/src/JT808.DotNetty.Codecs/JT808.DotNetty.Codecs.csproj b/src/JT808.DotNetty.Codecs/JT808.DotNetty.Codecs.csproj deleted file mode 100644 index 56628c4..0000000 --- a/src/JT808.DotNetty.Codecs/JT808.DotNetty.Codecs.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netstandard2.0 - 7.1 - Copyright 2018. - SmallChi - JT808.DotNetty.Codecs - JT808.DotNetty.Codecs - 基于DotNetty实现的JT808DotNetty的编解码库 - 基于DotNetty实现的JT808DotNetty的编解码库 - false - https://github.com/SmallChi/JT808DotNetty - https://github.com/SmallChi/JT808DotNetty - https://github.com/SmallChi/JT808DotNetty/blob/master/LICENSE - true - 1.0.0 - - - - - - - - - diff --git a/src/JT808.DotNetty.Codecs/JT808TcpDecoder.cs b/src/JT808.DotNetty.Codecs/JT808TcpDecoder.cs deleted file mode 100644 index 376194e..0000000 --- a/src/JT808.DotNetty.Codecs/JT808TcpDecoder.cs +++ /dev/null @@ -1,20 +0,0 @@ -using DotNetty.Buffers; -using DotNetty.Codecs; -using System.Collections.Generic; -using JT808.Protocol; -using DotNetty.Transport.Channels; - -namespace JT808.DotNetty.Codecs -{ - public class JT808TcpDecoder : ByteToMessageDecoder - { - protected override void Decode(IChannelHandlerContext context, IByteBuffer input, List output) - { - byte[] buffer = new byte[input.Capacity + 2]; - input.ReadBytes(buffer, 1, input.Capacity); - buffer[0] = JT808Package.BeginFlag; - buffer[input.Capacity + 1] = JT808Package.EndFlag; - output.Add(buffer); - } - } -} diff --git a/src/JT808.DotNetty.Codecs/JT808UdpDecoder.cs b/src/JT808.DotNetty.Codecs/JT808UdpDecoder.cs deleted file mode 100644 index fcf3455..0000000 --- a/src/JT808.DotNetty.Codecs/JT808UdpDecoder.cs +++ /dev/null @@ -1,20 +0,0 @@ -using DotNetty.Buffers; -using DotNetty.Codecs; -using DotNetty.Transport.Channels; -using System.Collections.Generic; -using DotNetty.Transport.Channels.Sockets; -using JT808.DotNetty.Core.Metadata; - -namespace JT808.DotNetty.Codecs -{ - public class JT808UdpDecoder : MessageToMessageDecoder - { - protected override void Decode(IChannelHandlerContext context, DatagramPacket message, List output) - { - IByteBuffer byteBuffer = message.Content; - byte[] buffer = new byte[byteBuffer.ReadableBytes]; - byteBuffer.ReadBytes(buffer); - output.Add(new JT808UdpPackage(buffer, message.Sender)); - } - } -}