filebuffer icon indicating copy to clipboard operation
filebuffer copied to clipboard

WriteAt doesn't seem to be working quite right

Open mattetti opened this issue 9 years ago • 4 comments

the std lib does some smart things around jumping to a specific, potentially non existing location and write there. If you do a write at to an existing point the existing is overwritten, we need tests for that.

mattetti avatar Aug 12 '16 01:08 mattetti

I assume the issues is related to the fact that the purpose of bytes.Buffer is to append and read from the current cursor, not really to seek it or overwrite existing sections in the buffer. I tried using the library in combination with wav.Encoder which was not fruitful so I replaced bytes.Buffer with a slice.

glaslos avatar Oct 10 '17 10:10 glaslos

Here is what I came up with: https://github.com/corticph/slicewriteseek

glaslos avatar Oct 11 '17 12:10 glaslos

Looks good!

mattetti avatar Oct 11 '17 14:10 mattetti

@mattetti Thank you for the library! Any update for WriteAt method?

sturfee-petrl avatar Nov 09 '21 23:11 sturfee-petrl