public static ViewInfo FromBinary(ISqlBinary binary) { using (var stream = binary.GetInput()) { var serializer = new BinarySerializer(); return((ViewInfo)serializer.Deserialize(stream)); } }
public static SqlXmlNode XmlType(ISqlBinary binary) { var len = binary.Length; var content = new byte[len]; var offset = 0; const int bufferSize = 1024 * 10; using (var stream = binary.GetInput()) { using (var reader = new BinaryReader(stream)) { while (true) { var buffer = new byte[bufferSize]; var readCount = reader.Read(buffer, 0, bufferSize); Array.Copy(buffer, 0, content, offset, readCount); if (readCount == 0) { break; } offset += readCount; } } } return(new SqlXmlNode(content)); }
public static SqlXmlNode XmlType(ISqlBinary binary) { var len = binary.Length; var content = new byte[len]; var offset = 0; const int bufferSize = 1024 * 10; using (var stream = binary.GetInput()) { using (var reader = new BinaryReader(stream)) { while (true) { var buffer = new byte[bufferSize]; var readCount = reader.Read(buffer, 0, bufferSize); Array.Copy(buffer, 0, content, offset, readCount); if (readCount == 0) break; offset += readCount; } } } return new SqlXmlNode(content); }
public static ViewInfo FromBinary(ISqlBinary binary) { using (var stream = binary.GetInput()) { var serializer = new BinarySerializer(); return (ViewInfo) serializer.Deserialize(stream); } }