![JAR search and dependency download from the Maven repository](/logo.png)
internal.io.FunctionalFileFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-io-base Show documentation
Show all versions of java-io-base Show documentation
Common IO utilities - Base
package internal.io;
import lombok.NonNull;
import nbbrd.io.FileFormatter;
import nbbrd.io.function.IOBiConsumer;
import java.io.IOException;
import java.io.OutputStream;
import static nbbrd.io.Resource.uncloseableOutputStream;
@lombok.RequiredArgsConstructor
public final class FunctionalFileFormatter implements FileFormatter {
private final @NonNull IOBiConsumer super T, ? super OutputStream> function;
@Override
public void formatStream(@NonNull T value, @NonNull OutputStream resource) throws IOException {
function.acceptWithIO(value, uncloseableOutputStream(resource));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy