Code example for NdefMessage

0
        NdefMessage[] msgs;
 
        public TagDescription(String title, byte[] bytes) {
            this.title = title;
            try { 
                msgs = new NdefMessage[] { new NdefMessage(bytes) };
            } catch (Exception e) {
                throw new RuntimeException("Failed to create tag description", e);
            } 
        } 
 
        public TagDescription(String title, NdefMessage[] msgs) {
            this.title = title;
            this.msgs = msgs;
        } 
 
        @Override 
        public String toString() {
            return title;
        } 
    }