code: public int samplesAvailableToEncode() {
      int available = 0;
      //sum all in blockQueue
      int channels = streamConfig.getChannelCount();
      for(BlockEncodeRequest ber : preparedRequests) {
        int[] block = ber.samples;
        available += block.length/channels;
      }
      if (unfilledRequest != null)
        available += unfilledRequest.count;
      return available;
    }
docs: Get number of samples that are available to encode. This includes samples
  which are in a partial block(and so would only be written if "end" was
  set true in encodeSamples(int count,boolean end);
  @return number of samples availble to encode.