![JAR search and dependency download from the Maven repository](/logo.png)
com.github.powerlibraries.io.builder.targets.StringTarget Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iopower Show documentation
Show all versions of iopower Show documentation
Power Libraries is a small project to collect some repeatedly needed or otherwise useful Java 8 classes in a collection of tiny libraries.
IO Power is the first and really tiny library of the Power Libraries. It contains some simple helper method for opening Input- and Outputstreams. The main purpose of IO Power is to make opening streams, readers and writers less cluttered and simple to understand.
The newest version!
package com.github.powerlibraries.io.builder.targets;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import com.github.powerlibraries.io.helper.stringout.StringBuilderOutputStream;
/**
* This class represents a string as the target.
* @author Manuel Hegner
*
*/
public class StringTarget implements Target {
private Charset charset;
private StringBuilderOutputStream lastStream;
public StringTarget(Charset charset) {
this.charset=charset;
}
@Override
public OutputStream openStream() throws IOException {
lastStream = new StringBuilderOutputStream(charset);
return lastStream;
}
public StringBuilderOutputStream getLastStream() {
return lastStream;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy