Is it true that converting from string
to []byte
allocates new memory? Also, does converting from []byte
to string
allocates new memory?
s := "a very long string"
b := []byte(s) // does this doubled the memory requirement?
b := []byte{1,2,3,4,5, ...very long bytes..}
s := string(b) // does this doubled the memory requirement?