Esempio n. 1
0
        private object ReadLargeObject(NpgsqlRowDescription.FieldData field_descr, int field_value_size)
        {
            var cms = new LargeMemoryStream(Stream, field_value_size);

            try
            {
                return
                    (NpgsqlTypesHelper.ConvertBackendStringToSystemType(
                         field_descr.TypeInfo,
                         new StreamReader(cms, Encoding.UTF8),
                         field_descr.TypeSize,
                         field_descr.TypeModifier));
            }
            catch (InvalidCastException ice)
            {
                return(ice);
            }
            catch (Exception ex)
            {
                return(new InvalidCastException(ex.Message, ex));
            }
        }
Esempio n. 2
0
		private object ReadLargeObject(NpgsqlRowDescription.FieldData field_descr, int field_value_size)
		{
			var cms = new LargeMemoryStream(Stream, field_value_size);
			try
			{
				return
					NpgsqlTypesHelper.ConvertBackendStringToSystemType(
						field_descr.TypeInfo,
						new StreamReader(cms, Encoding.UTF8),
						field_descr.TypeSize,
						field_descr.TypeModifier);
			}
			catch (InvalidCastException ice)
			{
				return ice;
			}
			catch (Exception ex)
			{
				return new InvalidCastException(ex.Message, ex);
			}
		}