vendredi 26 août 2016

[B4X] Bytes To File

Write an array of bytes to a file and read a file into an array of bytes.

Code:
  Sub BytesToFile (Dir As String, FileName As String, Data() As Byte)
Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)
out.WriteBytes(Data,
0, Data.Length)
out.Close
End Sub

Sub FileToBytes (Dir As String, FileName) As Byte()
Return Bit.InputStreamToBytes(File.OpenInput(Dir, FileName))
End Sub
Note that you can convert complex objects (and simple objects) to bytes and vice...

[B4X] Bytes To File

from B4X Community - Android, iOS, desktop, server and IoT programming tools http://ift.tt/2bd7QTi
via IFTTT

Aucun commentaire:

Enregistrer un commentaire