public void ToString(ProtocolOutput output, out string result) { result = ""; if (output == ProtocolOutput.ExploreToScratch) { result = ToString(); } }
public static IProtocol Generate(ProtocolOutput output, byte[] bytes, int offset, int length) { if (output == ProtocolOutput.ScratchToExplore) { return(ExploreProtocol.Create(ExploreProtocolDataType.DTInt, bytes, offset, length, false, "JSONProtocol")); } return(null); }
public static TProtocol Generate <TProtocol>(ProtocolOutput output, byte[] bytes, int offset, int length) where TProtocol : IProtocol { var result = Generate(output, bytes, offset, length); if (result is TProtocol) { return((TProtocol)result); } return(default(TProtocol)); }
public void ToBytes(ProtocolOutput output, out bool encryption, out byte[] bytes) { encryption = false; bytes = null; if (output == ProtocolOutput.ExploreToScratch) { var json = ToString(); bytes = Encoding.UTF8.GetBytes(json); } }