Exemplo n.º 1
0
func getAnnotationByteArr(goBytes []byte) *heap.Object {
	if goBytes != nil {
		jBytes := jutil.CastUint8sToInt8s(goBytes)
		return heap.NewByteArray(jBytes)
	}
	return nil
}
Exemplo n.º 2
0
// private static native byte[] getEntryBytes(long jzentry, int type);
// (JI)[B
func getEntryBytes(frame *rtda.Frame) {
	vars := frame.LocalVars()
	jzentry := vars.GetLong(0)
	_type := vars.GetInt(2)

	goBytes := _getEntryBytes(jzentry, _type)
	jBytes := jutil.CastUint8sToInt8s(goBytes)
	byteArr := heap.NewByteArray(jBytes)

	stack := frame.OperandStack()
	stack.PushRef(byteArr)
}
Exemplo n.º 3
0
// native byte[] getRawAnnotations();
// ()[B
func getRawAnnotations(frame *rtda.Frame) {
	vars := frame.LocalVars()
	this := vars.GetThis()

	class := this.Extra().(*heap.Class)
	goBytes := class.AnnotationData()
	if goBytes != nil {
		jBytes := jutil.CastUint8sToInt8s(goBytes)
		byteArr := heap.NewByteArray(jBytes)
		frame.OperandStack().PushRef(byteArr)
		return
	}

	frame.OperandStack().PushRef(nil)
}