os: make write_bytes() public

pull/1049/head
Alexander Medvednikov 2019-06-30 21:07:24 +02:00
parent fde0e39abf
commit ef5a91a87a
1 changed files with 2 additions and 2 deletions

View File

@ -198,11 +198,11 @@ pub fn (f File) write(s string) {
// convert any value to []byte (LittleEndian) and write it
// for example if we have write(7, 4), "07 00 00 00" gets written
// write(0x1234, 2) => "34 12"
fn (f File) write_bytes(data voidptr, size int) {
pub fn (f File) write_bytes(data voidptr, size int) {
C.fwrite(data, 1, size, f.cfile)
}
fn (f File) write_bytes_at(data voidptr, size, pos int) {
pub fn (f File) write_bytes_at(data voidptr, size, pos int) {
C.fseek(f.cfile, pos, SEEK_SET)
C.fwrite(data, 1, size, f.cfile)
C.fseek(f.cfile, 0, SEEK_END)