base.ByteArrayQueryResult Maven / Gradle / Ivy
/**
* Creative commons Attribution-NonCommercial license.
*
* http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB
*
* NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
*/
package base;
public class ByteArrayQueryResult implements QueryResult {
private byte[] values;
public ByteArrayQueryResult(byte[] values) {
this.values = values;
}
public ByteArrayQueryResult() {
}
public String toString() {
return toJson();
}
public String toJson() {
String result = "[";
for(int j = 0; j < values.length; j++) {
if(j != 0) {
result = result + ",";
}
result = result + (values[j] & 0xFF);
}
result = result + "]";
return result;
}
public byte[] getBytes() {
return values;
}
public void setBytes(byte[] values) {
this.values = values;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy