title: How to use ByteData and ByteBuffer in flutter without mirror package
body: <p>I am trying to develop a UDP application that receives data and converts the bytes into different data types.</p>
  
  <p>I have the code below that works when using Dart on its own.</p>
  
  <pre><code>import 'dart:io';
  import 'dart:typed_data';
  import 'dart:mirror';
  
  RawDatagramSocket.bind(InternetAddress.ANY_IP_V4, 20777).then((RawDatagramSocket socket){
    socket.listen((RawSocketEvent e){
      Datagram d = socket.receive();
      if (d == null) return;
      ByteBuffer buffer = d.data.buffer;
      DKByteData data = new DKByteData(buffer);
      exit(0);
    });
  });
  </code></pre>
  
  <p>The only issue is when I try to run it inside my Flutter application, VS code gives me an error at <code>d.data.buffer</code> saying <code>The getter 'buffer' isn't defined for the class 'List&lt;int&gt;'.</code></p>
  
  <p><code>import dart:mirror;</code> does not seem to work in flutter and <a href="https://github.com/flutter/flutter/issues/1150" rel="nofollow noreferrer">this page</a> says that dart mirrors is blocked in Flutter.</p>
  
  <p>As I cannot import dart mirror in order to get a Bytebuffer from a Datagram socket, how else am I able to do this?</p>