예제 #1
0
 public static void WriteByteArray(Stream fs, byte[] bytes)
 {
     if (bytes == null)
     {
         bytes = new byte[0];
     }
     FileSerializeHelper.WriteInt32(fs, bytes.Length);
     FileSerializeHelper.WriteBytes(fs, bytes);
 }
예제 #2
0
 public static void WriteString(Stream fs, string str)
 {
     if (str == null)
     {
         str = string.Empty;
     }
     byte[] bytes = Encoding.Unicode.GetBytes(str);
     FileSerializeHelper.WriteInt32(fs, bytes.Length);
     FileSerializeHelper.WriteBytes(fs, bytes);
 }