private int fill(byte[] buffer, int offset,int length) throws IOException {
		int sum = 0, len;
		while (sum<length) {
			len = is.read(buffer, offset+sum, length-sum);
			if (len<0) {
				throw new IOException("End of stream");
			}
			else sum+=len;
		}
		return sum;
	}
RFC 3267.
  
  AMR Streaming over RTP.
  
  Must be fed with an InputStream containing raw AMR NB
  Stream must begin with a 6 bytes long header: "#!AMR\n", it will be skipped
src/net/majorkernelpanic/streaming/rtp/AMRNBPacketizer.java