Disk-backed binary storage that supports all CRUD operations. Optional cloud extensions for aliyun-oss or s3 are available. All s3 compatible object stores should be supported with the latter.
First, add gimbap to your dependencies using the jitpack repository.
Store<byte[]> binaryStore = new BinaryStore();
String id = binaryStore.put("gimbap".getBytes());
byte[] data = binaryStore.get(id);
System.out.println(new String(data));
// prints gimbap
StreamingStore<byte[]> binaryStore = new BinaryStore();
String id = binaryStore.putStream(
new ByteArrayInputStream("gimbap".getBytes()));
byte[] data = binaryStore.get(id);
System.out.println(new String(data));
// prints gimbap
Add version 3.4.0 of the OSS SDK to your dependencies.
StreamingStore<byte[]> binaryStore = new OSSStore("endpoint",
"bucketName",
defaultCredentialProvider);
String id = binaryStore.put("gimbap".getBytes());
byte[] data = binaryStore.get(id);
System.out.println(new String(data));
// prints gimbap
Add version 1.X.X of the AWS SDK to your dependencies.
Store<byte[]> binaryStore = new S3Store(endpointConfiguration,
awsStaticCredentialsProvider,
"bucketName");