Code example for ByteBuffer

Methods: capacity, get, hasArray

0
	 */ 
	public static AiffData create(ByteBuffer buffer) {
		try { 
			byte[] bytes = null;
			 
			if(buffer.hasArray()) {
				bytes = buffer.array();
			} else { 
				bytes = new byte[buffer.capacity()];
				buffer.get(bytes);
			} 
			return create(bytes);
		} catch (Exception e) {
			e.printStackTrace();
			return null; 
		} 
	}	 
 
	/** 
	 * Creates a AiffData container from the specified stream 
	 *