All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.engine.jdbc.ReaderInputStream Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.engine.jdbc;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

/**
 * Exposes a {@link Reader} as an {@link InputStream}.
 * 
 * @author Gavin King
 */
public class ReaderInputStream extends InputStream {
	private Reader reader;

	/**
	 * Constructs a ReaderInputStream from a Reader
	 *
	 * @param reader The reader to expose as an InputStream
	 */
	public ReaderInputStream(Reader reader) {
		this.reader = reader;
	}

	@Override
	public int read() throws IOException {
		return reader.read();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy