com.peersafe.base.core.serialized.StreamSink Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chainsql Show documentation
Show all versions of chainsql Show documentation
ChainSQL JAVA API is an api for chainsql server
The newest version!
package com.peersafe.base.core.serialized;
import java.io.IOException;
import java.io.OutputStream;
public class StreamSink implements BytesSink {
OutputStream out;
public StreamSink(OutputStream out) {
this.out = out;
}
@Override
public void add(byte aByte) {
try {
out.write(aByte);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public void add(byte[] bytes) {
try {
out.write(bytes);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}