2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.io;
10 import com.google.common.io.ByteSource;
12 import java.io.IOException;
13 import java.io.InputStream;
14 import java.io.OutputStream;
15 import org.eclipse.jdt.annotation.NonNull;
17 final class PlainInputOutputStreamSupport extends InputOutputStreamFactory {
18 static final @NonNull PlainInputOutputStreamSupport INSTANCE = new PlainInputOutputStreamSupport();
20 private PlainInputOutputStreamSupport() {
25 public InputStream createInputStream(final ByteSource input) throws IOException {
26 return input.openBufferedStream();
30 public InputStream createInputStream(final File file) throws IOException {
31 return defaultCreateInputStream(file);
35 public OutputStream createOutputStream(final File file) throws IOException {
36 return defaultCreateOutputStream(file);
40 public OutputStream wrapOutputStream(final OutputStream output) throws IOException {