// Package go_testpkg is an autogenerated binder stub for package testpkg.
//   gobind -lang=go golang.org/x/mobile/bind/java/testpkg
//
// File is generated by gobind. Do not edit.
package go_testpkg

import (
	"golang.org/x/mobile/bind/java/testpkg"
	"golang.org/x/mobile/bind/seq"
)

func proxy_Add(out, in *seq.Buffer) {
	param_x := in.ReadInt()
	param_y := in.ReadInt()
	res := testpkg.Add(param_x, param_y)
	out.WriteInt(res)
}

func proxy_Call(out, in *seq.Buffer) {
	var param_i testpkg.I
	param_i_ref := in.ReadRef()
	if param_i_ref.Num < 0 {
		param_i = param_i_ref.Get().(testpkg.I)
	} else {
		param_i = (*proxyI)(param_i_ref)
	}
	testpkg.Call(param_i)
}

func proxy_Err(out, in *seq.Buffer) {
	param_s := in.ReadUTF16()
	err := testpkg.Err(param_s)
	if err == nil {
		out.WriteUTF16("")
	} else {
		out.WriteUTF16(err.Error())
	}
}

func proxy_GC(out, in *seq.Buffer) {
	testpkg.GC()
}

const (
	proxyIDescriptor = "go.testpkg.I"
	proxyIFCode      = 0x10a
)

type proxyI seq.Ref

func (p *proxyI) F() {
	out := new(seq.Buffer)
	seq.Transact((*seq.Ref)(p), proxyIFCode, out)
}

func proxy_Keep(out, in *seq.Buffer) {
	var param_i testpkg.I
	param_i_ref := in.ReadRef()
	if param_i_ref.Num < 0 {
		param_i = param_i_ref.Get().(testpkg.I)
	} else {
		param_i = (*proxyI)(param_i_ref)
	}
	testpkg.Keep(param_i)
}

func proxy_New(out, in *seq.Buffer) {
	res := testpkg.New()
	out.WriteGoRef(res)
}

func proxy_NumSCollected(out, in *seq.Buffer) {
	res := testpkg.NumSCollected()
	out.WriteInt(res)
}

const (
	proxySDescriptor = "go.testpkg.S"
	proxySFCode      = 0x00c
)

type proxyS seq.Ref

func proxySF(out, in *seq.Buffer) {
	ref := in.ReadRef()
	v := ref.Get().(*testpkg.S)
	v.F()
}

func init() {
	seq.Register(proxySDescriptor, proxySFCode, proxySF)
}

func proxy_StrDup(out, in *seq.Buffer) {
	param_s := in.ReadUTF16()
	res := testpkg.StrDup(param_s)
	out.WriteUTF16(res)
}

func init() {
	seq.Register("testpkg", 1, proxy_Add)
	seq.Register("testpkg", 2, proxy_Call)
	seq.Register("testpkg", 3, proxy_Err)
	seq.Register("testpkg", 4, proxy_GC)
	seq.Register("testpkg", 5, proxy_Keep)
	seq.Register("testpkg", 6, proxy_New)
	seq.Register("testpkg", 7, proxy_NumSCollected)
	seq.Register("testpkg", 8, proxy_StrDup)
}
