title: Connecting RadioStream and a MP3 decoder
body: <p>I'm trying to build an arduino web radio for reading the stream and decoding the stream I have the following two methods for writing and reading the stream, that need to be connected, but I can't think of a good way:</p>
  
  <p>In this method we read the radio stream and write its content to a 32 byte buffer.</p>
  
  <pre><code> uint8_t buff[32];
   // from the server, read them and print them:
  while (true)
  {
      int ret = client.read(buff, sizeof(buff) / 2 );
      if (ret &lt;= 0)
      break;
      for(int i = 0; i &lt; ret; i++)
      {//instead of Serial write we need to do something with the contents of this buffer
  
          Serial.write((char)buff[i]);
      }
  }
  </code></pre>
  
  <p>The next method takes the binary stream from the web radio and decodes it:</p>
  
  <pre><code>    int getMoreData(uint8_t *writeHere, int available)
      {
    /* TODO: write up to 'available' bytes of MP3 data 
     * to the location 'writeHere'. Return the actual number of bytes
     * that were written
     */}
  </code></pre>
  
  <p>The two methods need to be interconnected, but I'm not sure how.</p>
  
  <p>Thank you!   </p>