예제 #1
0
        public static byte[] EncodeInventoryVector(InventoryVector invVector)
        {
            var stream = new MemoryStream();

            EncodeInventoryVector(stream, invVector);
            return(stream.ToArray());
        }
예제 #2
0
 public static void EncodeInventoryVector(Stream stream, InventoryVector invVector)
 {
     using (var writer = new BinaryWriter(stream, Encoding.ASCII, leaveOpen: true))
     {
         writer.Write4Bytes(invVector.Type);
         writer.Write32Bytes(invVector.Hash);
     }
 }
예제 #3
0
 public static byte[] EncodeInventoryVector(InventoryVector invVector)
 {
     using (var stream = new MemoryStream())
         using (var writer = new BinaryWriter(stream))
         {
             EncodeInventoryVector(writer, invVector);
             return(stream.ToArray());
         }
 }
예제 #4
0
 public static void EncodeInventoryVector(BinaryWriter writer, InventoryVector invVector)
 {
     writer.WriteUInt32(invVector.Type);
     writer.WriteUInt256(invVector.Hash);
 }
예제 #5
0
 public async Task SendGetData(InventoryVector invVector)
 {
     await SendGetData(ImmutableArray.Create(invVector));
 }
예제 #6
0
 public async Task SendGetData(InventoryVector invVector)
 {
     await SendGetData(ImmutableArray.Create(invVector));
 }
예제 #7
0
 public static byte[] EncodeInventoryVector(InventoryVector invVector)
 {
     var stream = new MemoryStream();
     EncodeInventoryVector(stream, invVector);
     return stream.ToArray();
 }
예제 #8
0
 public static void EncodeInventoryVector(Stream stream, InventoryVector invVector)
 {
     using (var writer = new BinaryWriter(stream, Encoding.ASCII, leaveOpen: true))
     {
         writer.Write4Bytes(invVector.Type);
         writer.Write32Bytes(invVector.Hash);
     }
 }