Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 33a4b5d3a5aab85dcef2a2ee0106191b6e8024d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*******************************************************************************
 * Copyright (c) 2000, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.compare;

import org.eclipse.core.runtime.CoreException;

/**
 * Extension for <code>IStreamContentAccessor</code>. Extends the original
 * concept of a <code>IStreamContentAccessor</code> to answer the Charset (encoding) used for the stream.
 *
 * @since 3.0
 */
public interface IEncodedStreamContentAccessor extends IStreamContentAccessor {

	/**
	 * Returns the name of a charset encoding to be used when decoding this
	 * stream accessor's contents into characters. Returns <code>null</code> if a proper
	 * encoding cannot be determined.
	 * <p>
	 * <b>Note</b>:  this method does not check whether the result is a supported
	 * charset name. Callers should be prepared to handle
	 * <code>UnsupportedEncodingException</code> where this charset is used.
	 * </p>
	 * @return the name of a charset, or <code>null</code>
	 * @exception CoreException if an error happens while determining
	 * the charset. See any refinements for more information.
	 * @see IStreamContentAccessor#getContents
	 * @since 3.0
	 */
	String getCharset() throws CoreException;
}

Back to the top