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

shiver.me.timbers.aws.common.IOStreams Maven / Gradle / Ivy

There is a newer version: 1.4
Show newest version
package shiver.me.timbers.aws.common;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

public class IOStreams {

    public BufferedInputStream buffer(InputStream inputStream) {
        if (inputStream instanceof BufferedInputStream) {
            return (BufferedInputStream) inputStream;
        }
        return new BufferedInputStream(inputStream);
    }

    public String readString(InputStream stream, int byteNum) throws IOException {
        final byte[] buffer = new byte[byteNum];
        stream.read(buffer);
        return new String(buffer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy