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

com.aeontronix.commons.file.builder.FileContentMemoryImpl Maven / Gradle / Ivy

The newest version!
package com.aeontronix.commons.file.builder;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

class FileContentMemoryImpl implements FileContent {
    private byte[] data;

    public FileContentMemoryImpl(byte[] data) {
        this.data = data;
    }

    InputStream getInputStream() {
        return new ByteArrayInputStream(data);
    }

    @Override
    public long getSize() {
        return data.length;
    }

    @Override
    public InputStream getDataStream() {
        return new ByteArrayInputStream(data);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy