@@ -0,0 +1,1581 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage net.leeautumn.remoting.protocol;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * Created by LeeAutumn on 04/01/2017.%0A * blog: leeautumn.net%0A *%0A * @autuor : LeeAutumn%0A */%0Apublic abstract class AbstractProtocolSerializer implements ProtocolSerializer %7B%0A%0A    //%E8%BF%99%E4%B8%AA%E6%AD%A5%E9%AA%A4%E4%B8%BB%E8%A6%81%E6%98%AF%E7%94%A8%E6%9D%A5%E5%9C%A8%E7%AC%AC%E4%B8%80%E4%B8%AAbyte%E5%AD%97%E6%AE%B5%E8%A1%A8%E6%98%8E %E9%80%9A%E4%BF%A1%E5%8D%8F%E8%AE%AE%E7%B1%BB%E5%9E%8B,%E8%BF%99%E6%A0%B7%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E5%B0%B1%E8%83%BD%E6%A0%B9%E6%8D%AE%E8%BF%99%E4%B8%AA%E6%A0%87%E5%BF%97%E6%9D%A5%E5%BA%8F%E5%88%97%E5%8C%96%E7%89%B9%E5%AE%9A%E7%9A%84ProtocolMessage%E4%BA%86.%0A    @Override%0A    public byte%5B%5D serializeMessage(Object protocolMessage) %7B%0A        byte%5B%5D realMessage = serializeRealMessage(protocolMessage);%0A        byte%5B%5D result = new byte%5BrealMessage.length + 1%5D;%0A        result%5B0%5D = ((ProtocolMessage)protocolMessage).getHeader().getProtocolType();%0A        System.arraycopy(realMessage,0,result,1,realMessage.length);%0A        return result;%0A    %7D%0A%0A    public abstract byte%5B%5D serializeRealMessage(Object protocolMessage);%0A%7D%0A

add protocol type in bytes[0]