de.audioattack.io.UncloseableReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of console Show documentation
Show all versions of console Show documentation
A replacement for java.io.Console with a System.in and System.out based fallback
/*
* SPDX-FileCopyrightText: 2021 Marc Nause
*
* SPDX-License-Identifier: Apache-2.0
*/
package de.audioattack.io;
import java.io.IOException;
import java.io.Reader;
import java.util.Objects;
/* default */ class UncloseableReader extends Reader {
private final Reader reader;
UncloseableReader(final Reader reader) {
this.reader = Objects.requireNonNull(reader, "reader must not be ");
}
@Override
public int read(final char[] cbuff, final int off, final int len) throws IOException {
return reader.read(cbuff, off, len);
}
@Override
public void close() {
// ignore close
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy