using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Net; namespace ZeroLevel.Services.Serialization { public interface IBinaryReader : IDisposable { bool ReadBoolean(); char ReadChar(); byte ReadByte(); byte[] ReadBytes(); Double ReadDouble(); float ReadFloat(); short ReadShort(); ushort ReadUShort(); Int32 ReadInt32(); UInt32 ReadUInt32(); Int64 ReadLong(); UInt64 ReadULong(); string ReadString(); Guid ReadGuid(); DateTime? ReadDateTime(); decimal ReadDecimal(); TimeSpan ReadTimeSpan(); IPAddress ReadIP(); IPEndPoint ReadIPEndpoint(); #region Extensions #region Arrays T[] ReadArray() where T : IBinarySerializable, new(); string[] ReadStringArray(); IPAddress[] ReadIPArray(); IPEndPoint[] ReadIPEndPointArray(); Guid[] ReadGuidArray(); DateTime[] ReadDateTimeArray(); Int64[] ReadInt64Array(); Int32[] ReadInt32Array(); UInt64[] ReadUInt64Array(); UInt32[] ReadUInt32Array(); char[] ReadCharArray(); short[] ReadShortArray(); ushort[] ReadUShortArray(); float[] ReadFloatArray(); Double[] ReadDoubleArray(); bool[] ReadBooleanArray(); byte[] ReadByteArray(); byte[][] ReadByteArrayArray(); decimal[] ReadDecimalArray(); TimeSpan[] ReadTimeSpanArray(); #endregion #region Collections List ReadCollection() where T : IBinarySerializable, new(); List ReadStringCollection(); List ReadGuidCollection(); List ReadDateTimeCollection(); List ReadCharCollection(); List ReadInt64Collection(); List ReadInt32Collection(); List ReadDoubleCollection(); List ReadDecimalCollection(); List ReadTimeSpanCollection(); List ReadFloatCollection(); List ReadBooleanCollection(); List ReadByteCollection(); List ReadByteArrayCollection(); List ReadIPCollection(); List ReadIPEndPointCollection(); List ReadUInt64Collection(); List ReadUInt32Collection(); List ReadShortCollection(); List ReadUShortCollection(); #endregion #region Collections lazy IEnumerable ReadCollectionLazy() where T : IBinarySerializable, new(); IEnumerable ReadStringCollectionLazy(); IEnumerable ReadIPCollectionLazy(); IEnumerable ReadIPEndPointCollectionLazy(); IEnumerable ReadGuidCollectionLazy(); IEnumerable ReadDateTimeCollectionLazy(); IEnumerable ReadInt64CollectionLazy(); IEnumerable ReadInt32CollectionLazy(); IEnumerable ReadUInt64CollectionLazy(); IEnumerable ReadUInt32CollectionLazy(); IEnumerable ReadCharCollectionLazy(); IEnumerable ReadShortCollectionLazy(); IEnumerable ReadUShortCollectionLazy(); IEnumerable ReadFloatCollectionLazy(); IEnumerable ReadDoubleCollectionLazy(); IEnumerable ReadBooleanCollectionLazy(); IEnumerable ReadByteCollectionLazy(); IEnumerable ReadByteArrayCollectionLazy(); IEnumerable ReadDecimalCollectionLazy(); IEnumerable ReadTimeSpanCollectionLazy(); #endregion T Read() where T : IBinarySerializable; T Read(object arg) where T : IBinarySerializable; T ReadCompatible(); Dictionary ReadDictionary(); ConcurrentDictionary ReadDictionaryAsConcurrent(); #endregion Extensions Stream Stream { get; } } }