mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.9 KiB
81 lines
1.9 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Net;
|
|
|
|
namespace ZeroLevel.Services.Serialization
|
|
{
|
|
public interface IBinaryWriter
|
|
: IDisposable
|
|
{
|
|
void WriteBoolean(bool val);
|
|
|
|
void WriteByte(byte val);
|
|
|
|
void WriteBytes(byte[] val);
|
|
|
|
void WriteDouble(double val);
|
|
|
|
void WriteFloat(float val);
|
|
|
|
void WriteInt32(Int32 number);
|
|
|
|
void WriteLong(Int64 number);
|
|
|
|
void WriteString(string line);
|
|
|
|
void WriteGuid(Guid guid);
|
|
|
|
void WriteDateTime(DateTime? datetime);
|
|
|
|
void WriteDecimal(Decimal number);
|
|
|
|
void WriteTimeSpan(TimeSpan period);
|
|
|
|
void WriteIP(IPAddress ip);
|
|
|
|
void WriteIPEndpoint(IPEndPoint endpoint);
|
|
|
|
#region Extensions
|
|
|
|
void WriteCollection<T>(IEnumerable<T> collection)
|
|
where T : IBinarySerializable;
|
|
|
|
void WriteCollection(IEnumerable<string> collection);
|
|
|
|
void WriteCollection(IEnumerable<Guid> collection);
|
|
|
|
void WriteCollection(IEnumerable<DateTime> collection);
|
|
|
|
void WriteCollection(IEnumerable<Int64> collection);
|
|
|
|
void WriteCollection(IEnumerable<Int32> collection);
|
|
|
|
void WriteCollection(IEnumerable<Double> collection);
|
|
|
|
void WriteCollection(IEnumerable<Decimal> collection);
|
|
|
|
void WriteCollection(IEnumerable<TimeSpan> collection);
|
|
|
|
void WriteCollection(IEnumerable<float> collection);
|
|
|
|
void WriteCollection(IEnumerable<bool> collection);
|
|
|
|
void WriteCollection(IEnumerable<byte> collection);
|
|
|
|
void WriteCollection(IEnumerable<byte[]> collection);
|
|
|
|
void WriteCollection(IEnumerable<IPEndPoint> collection);
|
|
|
|
void WriteCollection(IEnumerable<IPAddress> collection);
|
|
|
|
void Write<T>(T item)
|
|
where T : IBinarySerializable;
|
|
|
|
void WriteCompatible<T>(T item);
|
|
|
|
#endregion Extensions
|
|
|
|
Stream Stream { get; }
|
|
}
|
|
} |