+/* class_get_annotations *******************************************************
+
+ Return the unparsed declared annotations in an byte array
+ of the given class (or NULL if there aren't any).
+
+*******************************************************************************/
+
+java_handle_bytearray_t *class_get_annotations(classinfo *c)
+{
+#if defined(ENABLE_ANNOTATIONS)
+ java_handle_bytearray_t *annotations = NULL;
+ uint32_t size = 0;
+
+ /* Return null for arrays and primitives: */
+ if (class_is_primitive(c) || class_is_array(c)) {
+ return NULL;
+ }
+
+ /* copy the annotations into a java byte array: */
+ if (c->annotations != NULL) {
+ size = c->annotations->size;
+ annotations = builtin_newarray_byte(size);
+
+ if(annotations != NULL) {
+ MCOPY(annotations->data, c->annotations->data, uint8_t, size);
+ }
+ }
+
+ return annotations;
+#else
+ return NULL;
+#endif
+}
+
+