code: public static int getDataFormatSupport(AudioFormat format) {
      int result = SUPPORTED;
      float sampleRate = format.getSampleRate();
      AudioFormat.Encoding encoding = format.getEncoding();
      if(format.getChannels() > 8 || format.getChannels() < 1)
        result |= UNSUPPORTED_CHANNELCOUNT;
      if(format.getSampleSizeInBits() > 24 || format.getSampleSizeInBits()%8 != 0)
        result |= UNSUPPORTED_SAMPLESIZE;
      if(sampleRate <= 0 || sampleRate > 655350 || sampleRate == AudioSystem.NOT_SPECIFIED)
        result |= UNSUPPORTED_SAMPLERATE;
      if ( !(AudioFormat.Encoding.ALAW.equals(encoding) ||
          AudioFormat.Encoding.ULAW.equals(encoding) ||
          AudioFormat.Encoding.PCM_SIGNED.equals(encoding) ||
          AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding) ) )
        result |= UNSUPPORTED_ENCODINGTYPE;
      return result;
    }
docs: Checks whether the given AudioFormat can be properly encoded by this
  FLAC library.
  @param format AudioFormat to test for support.
  @return Bit positions set according to issue:
  Bit Position : Problem-area
  0 : Channel count unsupported
  1 : Sample size unsupported
  2 : Sample Rate unsupported
  3 : Encoding Type Unsupported
  4-7: unused, always zero.
  return value of 0 means supported