Imports System.IO Module Module1 Dim corrente As New MemoryStream Dim sorgente() As Byte = {1, 4, 65, 3, 7} Dim destinazione(5) As Byte Sub Main() corrente.Write(sorgente, 0, sorgente.Length) corrente.Position = 0 corrente.Read(destinazione, 0, sorgente.Length) For n = 0 To sorgente.Length - 1 Console.WriteLine(destinazione(n)) Next Console.ReadKey() End Sub End ModuleEcco come scrivo con Write e leggo con Read.
WriteByte e ReadByte, invece, servono per leggere singoli bytes.
Nessun commento:
Posta un commento