private Collection<MimeType> _getMimeTypes(Collection<MimeType> mimeTypes, InputStream in) {

		if(mimeTypes.isEmpty() || mimeTypes.size() > 1) {
			try {
				Collection<MimeType> _mimeTypes = getMimeTypesInputStream(new BufferedInputStream(in));

				if(!_mimeTypes.isEmpty()) {
					if(!mimeTypes.isEmpty()) {
						// more than one glob matched

						// Check for same mime type
						for (MimeType mimeType : mimeTypes) {
							if(_mimeTypes.contains(mimeType)) {
								// mimeTypes = new ArrayList();
								mimeTypes.add(mimeType);
								// return mimeTypes;
							}
							// Check for mime type subtype
							for (MimeType _mimeType : _mimeTypes) {
								if(isMimeTypeSubclass(mimeType.toString(), _mimeType.toString())) {
									// mimeTypes = new ArrayList();
									mimeTypes.add(mimeType);
									// return mimeTypes;
								}
							}
						}
					} else {
						// No globs matched but we have magic matches
						return _mimeTypes;
					}
				}
			}catch(Exception e) {
				throw new MimeException(e);
			}finally {
				closeStream(in);
			}
		}
		return mimeTypes;

	}