com.hibegin.common.ByteStorable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simplewebserver Show documentation
Show all versions of simplewebserver Show documentation
Simple, flexible, less dependent, more extended. Less memory footprint, can quickly build Web project.
Can quickly run embedded, Android devices
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