/* Get the data and length for a byte view, given the byte view page. Return the pointer, or NULL on error, and set "*data_len" to the length.  */
const guint8* get_byte_view_data_and_length(GtkWidget *byte_view, guint *data_len)
/* Get the data and length for a byte view, given the byte view page. Return the pointer, or NULL on error, and set "*data_len" to the length.  */
const guint8* get_byte_view_data_and_length(GtkWidget *byte_view, guint *data_len)
{
    tvbuff_t *byte_view_tvb;
    const guint8 *data_ptr;
    byte_view_tvb = (tvbuff_t *)g_object_get_data(G_OBJECT(byte_view), E_BYTE_VIEW_TVBUFF_KEY);
    if (byte_view_tvb == NULL)
        return NULL;
    if ((*data_len = tvb_captured_length(byte_view_tvb))) {
        data_ptr = tvb_get_ptr(byte_view_tvb, 0, -1);
        return data_ptr;
    } else
        return "";
}