| /******************************************************************************* |
| * Copyright (c) 2001, 2004 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 |
| * Jens Lukowski/Innoopract - initial renaming/restructuring |
| * |
| *******************************************************************************/ |
| package org.eclipse.wst.html.core.tests.parser; |
| |
| import java.io.IOException; |
| import java.io.InputStream; |
| |
| |
| class NullInputStream extends InputStream { |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see java.io.InputStream#mark(int) |
| */ |
| public synchronized void mark(int readlimit) { |
| // nothing to do |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see java.io.InputStream#markSupported() |
| */ |
| public boolean markSupported() { |
| // we can mark nothing. |
| // and, we are using this Null class specifically for |
| // a "fake" resettable stream. |
| return true; |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see java.io.InputStream#read() |
| */ |
| public int read() throws IOException { |
| |
| return -1; |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see java.io.InputStream#reset() |
| */ |
| public synchronized void reset() throws IOException { |
| // nothing to do |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see java.io.InputStream#skip(long) |
| */ |
| public long skip(long n) throws IOException { |
| return 0; |
| } |
| } |