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

com.hibegin.common.ByteStorable Maven / Gradle / Ivy

Go to download

Simple, flexible, less dependent, more extended. Less memory footprint, can quickly build Web project. Can quickly run embedded, Android devices

There is a newer version: 0.3.162
Show newest version
package com.hibegin.common;

import com.hibegin.common.util.IOUtil;

import java.io.File;

public class ByteStorable extends AbstractStorable {


    public ByteStorable(byte[] data, String tempFileName) {
        super(data, tempFileName);
    }

    @Override
    protected long getDataSize(byte[] data) {
        return data.length;
    }

    @Override
    protected File serializeToFile(byte[] data, String filePath) {
        File file = new File(filePath + "/" + tempFileName);
        IOUtil.writeBytesToFile(data, file);
        return file;
    }

    @Override
    protected byte[] deserialize(byte[] bytes) {
        return bytes;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy