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 java.io.InputStream; 14 15 import org.eclipse.core.runtime.CoreException; 16 17 /** 18 * An <code>IStreamContentAccessor</code> object represents a set of bytes which can be 19 * accessed by means of a stream. 20 * <p> 21 * Clients may implement this interface, or use the standard implementation, 22 * <code>BufferedContent</code>. 23 * 24 * @see BufferedContent 25 */ 26 public interface IStreamContentAccessor { 27 /** 28 * Returns an open <code>InputStream</code> for this object which can be used to retrieve the object's content. 29 * The client is responsible for closing the stream when finished. 30 * Returns <code>null</code> if this object has no streamable contents. 31 * 32 * @return an input stream containing the contents of this object 33 * @exception CoreException if the contents of this object could not be accessed 34 */ 35 InputStream getContents() throws CoreException; 36 } 37