diff --git a/src/fr/devinsy/util/strings/StringListInputStream.java b/src/fr/devinsy/util/strings/StringListInputStream.java new file mode 100644 index 0000000..95ab552 --- /dev/null +++ b/src/fr/devinsy/util/strings/StringListInputStream.java @@ -0,0 +1,130 @@ +/** + * Copyright (C) 2013-2015 Christian Pierre MOMON + * + * This file is part of Devinsy-utils. + * + * Devinsy-utils is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Devinsy-utils is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Devinsy-utils. If not, see + */ +package fr.devinsy.util.strings; + +import java.io.IOException; +import java.io.InputStream; + +/** + * TODO CREATION STEP. + */ +public class StringListInputStream extends InputStream +{ + private StringList in; + + /** + * + */ + public StringListInputStream() + { + this.in = new StringList(); + } + + /** + * + */ + public StringListInputStream(final int size) + { + this.in = new StringList(size); + } + + /** + * + */ + public StringListInputStream(final StringList source) + { + if (source == null) + { + throw new NullPointerException("source is null."); + } + else + { + this.in = source; + } + } + + /** + * {@inheritDoc} + */ + @Override + public int available() throws IOException + { + return 0; + } + + /** + * {@inheritDoc} + */ + @Override + public void close() throws IOException + { + } + + /** + * {@inheritDoc} + */ + @Override + public synchronized void mark(final int readlimit) + { + // TODO + } + + /** + * {@inheritDoc} + */ + @Override + public boolean markSupported() + { + boolean result; + + result = true; + + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public int read() throws IOException + { + // TODO Auto-generated method stub + return 0; + } + + /** + * {@inheritDoc} + */ + @Override + public synchronized void reset() throws IOException + { + // TODO + throw new IOException("mark/reset not supported"); + } + + /** + * {@inheritDoc} + */ + @Override + public long skip(final long n) throws IOException + { + // TODO + return 0; + } +}