/
n-dimens
/
pascalabcnet
Обзор
Документация
Войти
/
n-dimens
/
pascalabcnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
VisualPascalABCNET/FormsDesignerBinding/Dependecies/src/Main/ICSharpCode.SharpDevelop.BuildWorker/ExtendedBinaryReader.cs
41 строка
974 B
Бондарев Иван
initial commit
14 май 2015, 22:35
14 май 2015, 22:35
e6e67c1
Код
Авторство
О чём код?
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.IO; namespace ICSharpCode.SharpDevelop.BuildWorker { static class BinaryReaderExtensions { public static string ReadNullableString(this BinaryReader reader) { if (reader.ReadBoolean()) return reader.ReadString(); else return null; } public static void WriteNullableString(this BinaryWriter writer, string s) { writer.Write(s != null); if (s != null) writer.Write(s); } public static DateTime ReadDateTime(this BinaryReader reader) { return new DateTime(reader.ReadInt64()); } public static void WriteDateTime(this BinaryWriter writer, DateTime date) { writer.Write(date.Ticks); } public static void WriteInt32(this BinaryWriter writer, int val) { writer.Write(val); } } }