⚡ fonksiyon
read_to_bytes
fonksiyon read_to_bytes
Reads entire file content as a byte array.
Dosya içeriğini byte array olarak okur.
Parameters / Parametreler
path: File path / Dosya yolu
Returns / Dönüş Değeri
Ok(List[Byte]): File content (raw bytes) / Dosya içeriği (raw bytes)Err(String): File not found / Dosya bulunamadı
Example / Örnek
// Check PNG header / PNG başlığını kontrol et
değişken veriler = io.read_to_bytes("resim.png")?
eğer veriler[0] == 0x89 && veriler[1] == 0x50 yap
io.println("Geçerli PNG dosyası")
son
Performance / Performans
O(n) - Same speed as read_to_string() / read_to_string() ile aynı hızda