1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.compare; 12 13 import org.eclipse.core.runtime.CoreException; 14 15 /** 16 * Extension for <code>IStreamContentAccessor</code>. Extends the original 17 * concept of a <code>IStreamContentAccessor</code> to answer the Charset (encoding) used for the stream. 18 * 19 * @since 3.0 20 */ 21 public interface IEncodedStreamContentAccessor extends IStreamContentAccessor { 22 23 /** 24 * Returns the name of a charset encoding to be used when decoding this 25 * stream accessor's contents into characters. Returns <code>null</code> if a proper 26 * encoding cannot be determined. 27 * <p> 28 * <b>Note</b>: this method does not check whether the result is a supported 29 * charset name. Callers should be prepared to handle 30 * <code>UnsupportedEncodingException</code> where this charset is used. 31 * </p> 32 * @return the name of a charset, or <code>null</code> 33 * @exception CoreException if an error happens while determining 34 * the charset. See any refinements for more information. 35 * @see IStreamContentAccessor#getContents 36 * @since 3.0 37 */ 38 String getCharset() throws CoreException; 39 } 40