internal RecordingConnection(Connection connection) { try { recordingInputStream = new RecordingInputStream(connection.InputStream.BaseStream); recordingOutputStream = new RecordingOutputStream(connection.OutputStream.BaseStream); in_stream = new System.IO.StreamReader(recordingInputStream); out_stream = new System.IO.StreamWriter(recordingOutputStream); } catch (System.IO.IOException e) { throw new RuntimeException(e); } }
public override FieldValue Decode(System.IO.Stream in_Renamed, Group decodeTemplate, Context context, BitVectorReader presenceMapReader) { try { ScalarValue previousValue = null; if (operator_Renamed.UsesDictionary()) { previousValue = context.Lookup(Dictionary, decodeTemplate, Key); ValidateDictionaryTypeAgainstFieldType(previousValue, type); } ScalarValue value_Renamed; int pmapIndex = presenceMapReader.Index; if (IsPresent(presenceMapReader)) { if (context.TraceEnabled) { in_Renamed = new RecordingInputStream(in_Renamed); } if (!operatorCodec.ShouldDecodeType()) { return(operatorCodec.DecodeValue(null, null, this)); } ScalarValue decodedValue = typeCodec.Decode(in_Renamed); value_Renamed = DecodeValue(decodedValue, previousValue); if (context.TraceEnabled) { context.DecodeTrace.Field(this, value_Renamed, decodedValue, ((RecordingInputStream)in_Renamed).Buffer, pmapIndex); } } else { value_Renamed = Decode(previousValue); } ValidateDecodedValueIsCorrectForType(value_Renamed, type); if (!((Operator == Template.Operator.Operator.DELTA) && (value_Renamed == null))) { context.Store(Dictionary, decodeTemplate, Key, value_Renamed); } return(value_Renamed); } catch (FastException e) { throw new FastException("Error occurred while decoding " + this, e.Code, e); } }
public override FieldValue Decode(System.IO.Stream in_Renamed, Group decodeTemplate, Context context, BitVectorReader presenceMapReader) { try { ScalarValue previousValue = null; if (operator_Renamed.UsesDictionary()) { previousValue = context.Lookup(Dictionary, decodeTemplate, Key); ValidateDictionaryTypeAgainstFieldType(previousValue, type); } ScalarValue value_Renamed; int pmapIndex = presenceMapReader.Index; if (IsPresent(presenceMapReader)) { if (context.TraceEnabled) in_Renamed = new RecordingInputStream(in_Renamed); if (!operatorCodec.ShouldDecodeType()) { return operatorCodec.DecodeValue(null, null, this); } ScalarValue decodedValue = typeCodec.Decode(in_Renamed); value_Renamed = DecodeValue(decodedValue, previousValue); if (context.TraceEnabled) context.DecodeTrace.Field(this, value_Renamed, decodedValue, ((RecordingInputStream) in_Renamed).Buffer, pmapIndex); } else { value_Renamed = Decode(previousValue); } ValidateDecodedValueIsCorrectForType(value_Renamed, type); if (!((Operator == Template.Operator.Operator.DELTA) && (value_Renamed == null))) { context.Store(Dictionary, decodeTemplate, Key, value_Renamed); } return value_Renamed; } catch (FastException e) { throw new FastException("Error occurred while decoding " + this, e.Code, e); } }
internal RecordingConnection(Connection connection) { try { recordingInputStream = new RecordingInputStream(connection.InputStream.BaseStream); recordingOutputStream = new RecordingOutputStream(connection.OutputStream.BaseStream); in_stream = new System.IO.StreamReader(recordingInputStream); out_stream = new System.IO.StreamWriter(recordingOutputStream); } catch (System.IO.IOException e) { throw new RuntimeException(e); } }