Code example for ByteBuffer

Methods: limitpositionget

	 * @return true if the audioData is of type "audio", false if not. 
	final boolean checkIfMimeAudioType(ByteBuffer audioData, int offset)
		// No point in checking audio type unless we have at least five bytes. 
		if (audioData.limit() < 5)
			//	"Resource was smaller than 5 bytes"); 
			return false; 
		// Save current position on the byte buffer. 
		int savedPosition = audioData.position();
		// Read first five bytes of audio data. 
		byte header[] = new byte[5];
		// Restore buffer position. 
		// Check mime type. 
		return checkIfMimeAudioType(header);
Connect your IDE to all the code out there  Get Codota for Java