package jp.cssj.cti.helpers;

import java.io.IOException;

/**
 * 何も生成しないビルダです。
 * 
 * @author <a href="mailto:miyabe at gnn.co.jp">MIYABE Tatsuhiko </a>
 * @version $Id: NullContentBuilder.java,v 1.1 2005/08/03 02:17:30 harumanx Exp $
 */
public class NullContentBuilder implements PositionalContentBuilder {
	private static final Info NULL_INFO = new Info() {
		public long getPosition(int id) {
			return 0;
		}
	};

	public static final NullContentBuilder SHARED_INSTANCE = new NullContentBuilder();

	public Info getPositionalInfo() {
		return NULL_INFO;
	}

	public void addFragment() throws IOException {
		// ignore
	}

	public void insertFragmentBefore(int anchorId) throws IOException {
		// ignore
	}

	public void write(int id, byte[] b, int off, int len) throws IOException {
		// ignore
	}

	public void close(int id) throws IOException {
		// ignore
	}

	public long getLength() {
		return 0;
	}

	public void finish() throws IOException {
		// ignore
	}

	protected void finalize() throws IOException {
		// ignore
	}
}