test_class.declarator: session
test_class.modifier: private
test_class.original_string: private IoSession session;
test_class.type: IoSession
test_class.var_name: session
test_class.declarator: TEMPLATE_TITLE = "FAST_2"
test_class.modifier: private static final
test_class.original_string: private static final String TEMPLATE_TITLE = "FAST_2";
test_class.type: String
test_class.var_name: TEMPLATE_TITLE
test_class.declarator: CORE_ALIAS = new CoreVersion().getAlias()
test_class.modifier: private static final
test_class.original_string: private static final String CORE_ALIAS = new CoreVersion().getAlias();
test_class.type: String
test_class.var_name: CORE_ALIAS
test_class.declarator: DICTIONARY_URI = SailfishURI.unsafeParse(CORE_ALIAS + ":" + TEMPLATE_TITLE)
test_class.modifier: private static final
test_class.original_string: private static final SailfishURI DICTIONARY_URI = SailfishURI.unsafeParse(CORE_ALIAS + ":" + TEMPLATE_TITLE);
test_class.type: SailfishURI
test_class.var_name: DICTIONARY_URI
test_class.declarator: TEMPLATE_TITLE_V_1_2 = "FAST_V_1_2"
test_class.modifier: private static final
test_class.original_string: private static final String TEMPLATE_TITLE_V_1_2 = "FAST_V_1_2";
test_class.type: String
test_class.var_name: TEMPLATE_TITLE_V_1_2
test_class.declarator: DICTIONARY_URI_V_1_2 = SailfishURI.unsafeParse(CORE_ALIAS + ":" + TEMPLATE_TITLE)
test_class.modifier: private static final
test_class.original_string: private static final SailfishURI DICTIONARY_URI_V_1_2 = SailfishURI.unsafeParse(CORE_ALIAS + ":" + TEMPLATE_TITLE);
test_class.type: SailfishURI
test_class.var_name: DICTIONARY_URI_V_1_2
test_class.declarator: msgFactory = DefaultMessageFactory.getFactory()
test_class.modifier: private static final
test_class.original_string: private static final IMessageFactory msgFactory = DefaultMessageFactory.getFactory();
test_class.type: IMessageFactory
test_class.var_name: msgFactory
test_class.file: BackEnd/Service/service-fast/src/test/java/com/exactpro/sf/services/fast/TestFastCodec.java
test_class.identifier: TestFastCodec
test_class.superclass: extends FASTServicePluginTest
test_case.body: @Test
  	public void testEncodeMessageV_1_2() throws Exception
  	{
  		byte[] sourceArray = {
  				(byte) 0xb3, (byte) 0xc0, (byte) 0x81, (byte) 0xb0, (byte) 0x32, (byte) 0x30, (byte) 0x31, (byte) 0x32, (byte) 0x30, (byte) 0x31, (byte) 0x30, (byte) 0x31, (byte) 0x2d, (byte) 0x30, (byte) 0x31, (byte) 0x3a,
  				(byte) 0x30, (byte) 0x31, (byte) 0x3a, (byte) 0x30, (byte) 0x31, (byte) 0x2e, (byte) 0x33, (byte) 0x33, (byte) 0xb3, (byte) 0xb0, (byte) 0x80, (byte) 0x4d, (byte) 0x41, (byte) 0x44, (byte) 0x54, (byte) 0x59,
  				(byte) 0xb0, (byte) 0x74, (byte) 0x6e, (byte) 0x70, (byte) 0x31, (byte) 0x32, (byte) 0xb3, (byte) 0x80, (byte) 0x80, (byte) 0x81, (byte) 0x15, (byte) 0x6f, (byte) 0x6a, (byte) 0x2c, (byte) 0x14, (byte) 0x75,
  				(byte) 0x3d, (byte) 0x3c, (byte) 0xab, (byte) 0x81
  		};
  		FASTCodec codec = getCodec(DICTIONARY_URI_V_1_2, TEMPLATE_TITLE_V_1_2);
  
  		ProtocolEncoderOutput output = new MockProtocolEncoderOutput();
  
  		IMessage message = msgFactory.createMessage("Logon", "Test");
  
  		message.addField("Password", "tnp123");
  		message.addField("Username", "MADTY0" );
  		message.addField("SendingTime", "20120101-01:01:01.333");
  		message.addField("ApplID", "0");
  		message.addField("MessageType", "0");
  		message.addField("EndOfTransaction", true);
  		message.addField("Timestamp", LocalDateTime.of(2019, 12, 12, 15, 30, 30, 555));
  		message.addField("DeleteReason", 0);
  
  		session.write(message);
  		codec.encode(session, message, output);
  		Queue<Object> msgQueue = ((AbstractProtocolEncoderOutput)output).getMessageQueue();
  		Object lastMessage = msgQueue.element();
  		byte[] asd = ((IoBuffer)lastMessage).array();
  		int limit = ((IoBuffer)lastMessage).limit();
  		byte[] bytes = Arrays.copyOf(asd, limit );
  
  		session.write(lastMessage);
  		System.out.println(HexDumper.getHexdump(bytes));
  		Assert.assertArrayEquals("Compare source and encoded\n" + HexDumper.getHexdump(bytes), sourceArray, bytes);
  	}
test_case.class_method_signature: TestFastCodec.testEncodeMessageV_1_2()
test_case.full_signature: @Test public void testEncodeMessageV_1_2()
test_case.identifier: testEncodeMessageV_1_2
test_case.invocations: getCodec createMessage addField addField addField addField addField addField addField of addField write encode getMessageQueue element array limit copyOf write println getHexdump assertArrayEquals getHexdump
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEncodeMessageV_1_2()
focal_class.declarator: INPUT_CONTEXT_ATTR_NAME = "FAST_INPUT_CONTEXT"
focal_class.modifier: private static final
focal_class.original_string: private static final String INPUT_CONTEXT_ATTR_NAME = "FAST_INPUT_CONTEXT";
focal_class.type: String
focal_class.var_name: INPUT_CONTEXT_ATTR_NAME
focal_class.declarator: OUTPUT_CONTEXT_ATTR_NAME = "FAST_OUTPUT_CONTEXT"
focal_class.modifier: private static final
focal_class.original_string: private static final String OUTPUT_CONTEXT_ATTR_NAME = "FAST_OUTPUT_CONTEXT";
focal_class.type: String
focal_class.var_name: OUTPUT_CONTEXT_ATTR_NAME
focal_class.declarator: logger = LoggerFactory.getLogger(FASTCodec.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger logger = LoggerFactory.getLogger(FASTCodec.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: serviceContext
focal_class.modifier: private
focal_class.original_string: private IServiceContext serviceContext;
focal_class.type: IServiceContext
focal_class.var_name: serviceContext
focal_class.declarator: msgDictionary
focal_class.modifier: private
focal_class.original_string: private IDictionaryStructure msgDictionary;
focal_class.type: IDictionaryStructure
focal_class.var_name: msgDictionary
focal_class.declarator: converter
focal_class.modifier: private
focal_class.original_string: private FastToIMessageConverter converter;
focal_class.type: FastToIMessageConverter
focal_class.var_name: converter
focal_class.declarator: settings
focal_class.modifier: private
focal_class.original_string: private FASTCodecSettings settings;
focal_class.type: FASTCodecSettings
focal_class.var_name: settings
focal_class.declarator: registry
focal_class.modifier: private
focal_class.original_string: private TemplateRegistry registry;
focal_class.type: TemplateRegistry
focal_class.var_name: registry
focal_class.declarator: iMsgToFastConverter
focal_class.modifier: private
focal_class.original_string: private IMessageToFastConverter iMsgToFastConverter;
focal_class.type: IMessageToFastConverter
focal_class.var_name: iMsgToFastConverter
focal_class.declarator: decoder
focal_class.modifier: private
focal_class.original_string: private FastToIMessageDecoder decoder;
focal_class.type: FastToIMessageDecoder
focal_class.var_name: decoder
focal_class.file: BackEnd/Service/service-fast/src/main/java/com/exactpro/sf/services/fast/FASTCodec.java
focal_class.identifier: FASTCodec
focal_class.class_method_signature: FASTCodec.init(
  			IServiceContext serviceContext,
  			ICommonSettings settings,
  			IMessageFactory msgFactory, IDictionaryStructure dictionary)
focal_class.full_signature: @Override public void init(
  			IServiceContext serviceContext,
  			ICommonSettings settings,
  			IMessageFactory msgFactory, IDictionaryStructure dictionary)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (
  			IServiceContext serviceContext,
  			ICommonSettings settings,
  			IMessageFactory msgFactory, IDictionaryStructure dictionary)
focal_class.return: void
focal_class.signature: void init(
  			IServiceContext serviceContext,
  			ICommonSettings settings,
  			IMessageFactory msgFactory, IDictionaryStructure dictionary)
focal_class.class_method_signature: FASTCodec.getRegistry()
focal_class.full_signature: private TemplateRegistry getRegistry()
focal_class.identifier: getRegistry
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: TemplateRegistry
focal_class.signature: TemplateRegistry getRegistry()
focal_class.class_method_signature: FASTCodec.createFastContext()
focal_class.full_signature: protected Context createFastContext()
focal_class.identifier: createFastContext
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Context
focal_class.signature: Context createFastContext()
focal_class.class_method_signature: FASTCodec.getSettings()
focal_class.full_signature: protected FASTCodecSettings getSettings()
focal_class.identifier: getSettings
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: FASTCodecSettings
focal_class.signature: FASTCodecSettings getSettings()
focal_class.class_method_signature: FASTCodec.doDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.full_signature: @Override protected boolean doDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.identifier: doDecode
focal_class.modifiers: @Override protected
focal_class.parameters: (
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.return: boolean
focal_class.signature: boolean doDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.class_method_signature: FASTCodec.decode(IoSession session, IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.full_signature: @Override public void decode(IoSession session, IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.identifier: decode
focal_class.modifiers: @Override public
focal_class.parameters: (IoSession session, IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.return: void
focal_class.signature: void decode(IoSession session, IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.class_method_signature: FASTCodec.doRealDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.full_signature: private boolean doRealDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.identifier: doRealDecode
focal_class.modifiers: private
focal_class.parameters: (
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.return: boolean
focal_class.signature: boolean doRealDecode(
  			IoSession session,
  			IoBuffer in,
  			ProtocolDecoderOutput out)
focal_class.class_method_signature: FASTCodec.fillMessageMetadata(
  			IoSession session,
  			IoBuffer in,
  			IMessage imsg)
focal_class.full_signature: private void fillMessageMetadata(
  			IoSession session,
  			IoBuffer in,
  			IMessage imsg)
focal_class.identifier: fillMessageMetadata
focal_class.modifiers: private
focal_class.parameters: (
  			IoSession session,
  			IoBuffer in,
  			IMessage imsg)
focal_class.return: void
focal_class.signature: void fillMessageMetadata(
  			IoSession session,
  			IoBuffer in,
  			IMessage imsg)
focal_class.class_method_signature: FASTCodec.getInputContext(IoSession session)
focal_class.full_signature: private Context getInputContext(IoSession session)
focal_class.identifier: getInputContext
focal_class.modifiers: private
focal_class.parameters: (IoSession session)
focal_class.return: Context
focal_class.signature: Context getInputContext(IoSession session)
focal_class.class_method_signature: FASTCodec.getOutputContext(IoSession session)
focal_class.full_signature: private Context getOutputContext(IoSession session)
focal_class.identifier: getOutputContext
focal_class.modifiers: private
focal_class.parameters: (IoSession session)
focal_class.return: Context
focal_class.signature: Context getOutputContext(IoSession session)
focal_class.class_method_signature: FASTCodec.encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_class.full_signature: @Override public void encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_class.identifier: encode
focal_class.modifiers: @Override public
focal_class.parameters: (
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_class.return: void
focal_class.signature: void encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_class.class_method_signature: FASTCodec.getIMessageToFastConverter()
focal_class.full_signature: private IMessageToFastConverter getIMessageToFastConverter()
focal_class.identifier: getIMessageToFastConverter
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: IMessageToFastConverter
focal_class.signature: IMessageToFastConverter getIMessageToFastConverter()
focal_class.superclass: extends AbstractCodec
focal_method.body: @Override
  	public void encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out) throws Exception {
  
  		IMessageToFastConverter converter = getIMessageToFastConverter();
  		IMessage iMsg = (IMessage) message;
  
          Message fastMsg = converter.convert(iMsg);
  		ByteArrayOutputStream os = new ByteArrayOutputStream();
  		Context oc = getOutputContext(session);
  		MessageOutputStream msgOutStream = new MessageOutputStream(os, oc);
  		msgOutStream.writeMessage(fastMsg);
  		byte[] outputdata = os.toByteArray();
  		byte[] blockHeader = TypeCodec.UINT.encode(new IntegerValue(outputdata.length));
  
  		byte[] result = Arrays.copyOf(blockHeader, blockHeader.length + outputdata.length);
  		System.arraycopy(outputdata, 0, result, blockHeader.length, outputdata.length);
  
  		out.write(IoBuffer.wrap(result));
  		if (settings.isResetContextAfterEachUdpPacket()) {
  			oc.reset();
  		}
  	}
focal_method.class_method_signature: FASTCodec.encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_method.full_signature: @Override public void encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_method.identifier: encode
focal_method.invocations: getIMessageToFastConverter convert getOutputContext writeMessage toByteArray encode copyOf arraycopy write wrap isResetContextAfterEachUdpPacket reset
focal_method.modifiers: @Override public
focal_method.parameters: (
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)
focal_method.return: void
focal_method.signature: void encode(
  			IoSession session,
  			Object message,
  			ProtocolEncoderOutput out)