Re: [go-nuts] Re: gobind generated constructor for struct containing []byte sometimes corrupts data

2017-08-03 Thread Antonio Marcedone
ot again! On Thursday, August 3, 2017 at 1:33:03 AM UTC-7, Elias Naur wrote: > > Yes, byte slices are special and are not reference counted like other > objects. You need to copy it on the Go side. > > - elias > > Den tor. 3. aug. 2017 03.21 skrev Antonio Marcedone >

[go-nuts] Re: gobind generated constructor for struct containing []byte sometimes corrupts data

2017-08-02 Thread Antonio Marcedone
object's native side, so that the reference can be > removed, potentially allowing the object to be reclaimed by its native > garbage collector. The mechanism is symmetric. On Wednesday, August 2, 2017 at 5:30:16 PM UTC-7, Antonio Marcedone wrote: > > I am not sure I unders

[go-nuts] Re: gobind generated constructor for struct containing []byte sometimes corrupts data

2017-08-02 Thread Antonio Marcedone
I am not sure I understand what is going on here. For reference, the relevant code is: String s = "This is a test string"; MyStruct struct = new MyStruct(s.getBytes("UTF-8")); //struct.setE(s.getBytes("UTF-8")); tv.append("\nFirst time: "+ new Strin

[go-nuts] gobind generated constructor for struct containing []byte sometimes corrupts data

2017-08-02 Thread Antonio Marcedone
Hi, I am encountering a strange problem when using gobind. In short, initializing a struct containing a go byte array from Java and then getting such byte array sometimes returns a different value. I think this might be a bug with gobind. I asked about it on stackoverflow here https://stackov