' ROUTINE 1
Dim bb As B4XBytesBuilder
bb.Initialize
bb.Append(File.ReadBytes("", nome_file_completo))
SingleReplace(bb, data_da_cercare.GetBytes("ascii"), data_da_impostare_stringa.GetBytes("ascii"))
File.WriteBytes("", nome_file_destinazione, bb.ToArray)
' ROUTINE 2
Dim st As String
Dim by() As Byte= File.ReadBytes("",nome_file_completo)
st=BytesToString(by,0,by.Length,"ASCII")
st=st.Replace(data_da_cercare,data_da_impostare_stringa)
by= st.GetBytes("ASCII")
File.WriteBytes("",nome_file_destinazione,by)
Private Sub SingleReplace(bb As B4XBytesBuilder, SearchFor() As Byte, ReplaceWith() As Byte)
Dim i As Int = bb.IndexOf(SearchFor)
If i > -1 Then
bb.Remove(i, i + SearchFor.Length)
bb.Insert(i, ReplaceWith)
End If
End Sub