diff --git a/NewLife.Core/Serialization/Binary/Binary.cs b/NewLife.Core/Serialization/Binary/Binary.cs
index e5544b7..46d478d 100644
--- a/NewLife.Core/Serialization/Binary/Binary.cs
+++ b/NewLife.Core/Serialization/Binary/Binary.cs
@@ -132,7 +132,7 @@ namespace NewLife.Serialization
/// <param name="buffer">包含要写入的数据的字节数组。</param>
/// <param name="offset">buffer 中开始写入的起始点。</param>
/// <param name="count">要写入的字节数。</param>
- public virtual void Write(Byte[] buffer, Int32 offset = 0, Int32 count = -1)
+ public virtual void Write(Byte[] buffer, Int32 offset, Int32 count)
{
if (count < 0) count = buffer.Length - offset;
Stream.Write(buffer, offset, count);
diff --git a/NewLife.Core/Serialization/Binary/BinaryNormal.cs b/NewLife.Core/Serialization/Binary/BinaryNormal.cs
index 4a711d3..8f4f995 100644
--- a/NewLife.Core/Serialization/Binary/BinaryNormal.cs
+++ b/NewLife.Core/Serialization/Binary/BinaryNormal.cs
@@ -39,13 +39,15 @@ namespace NewLife.Serialization
}
else if (type == typeof(IPAddress))
{
- Write(((IPAddress)value).GetAddressBytes(), -1);
+ Host.Write(((IPAddress)value).GetAddressBytes());
+ return true;
}
else if (type == typeof(IPEndPoint))
{
var ep = value as IPEndPoint;
- Write(ep.Address.GetAddressBytes(), -1);
+ Host.Write(ep.Address.GetAddressBytes());
Host.Write((UInt16)ep.Port);
+ return true;
}
return false;
diff --git a/NewLife.Core/Serialization/Binary/IBinary.cs b/NewLife.Core/Serialization/Binary/IBinary.cs
index 14fa6dd..ee5d581 100644
--- a/NewLife.Core/Serialization/Binary/IBinary.cs
+++ b/NewLife.Core/Serialization/Binary/IBinary.cs
@@ -36,7 +36,7 @@ namespace NewLife.Serialization
/// <param name="buffer">包含要写入的数据的字节数组。</param>
/// <param name="offset">buffer 中开始写入的起始点。</param>
/// <param name="count">要写入的字节数。</param>
- void Write(Byte[] buffer, Int32 offset = 0, Int32 count = -1);
+ void Write(Byte[] buffer, Int32 offset, Int32 count);
/// <summary>写入大小</summary>
/// <param name="size">要写入的大小值</param>