use of com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange in project java-bigtable by googleapis.
the class RangeTest method byteStringSerializationTest.
@Test
public void byteStringSerializationTest() throws IOException, ClassNotFoundException {
ByteStringRange expected = ByteStringRange.create("a", "z");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(expected);
oos.close();
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
ByteStringRange actual = (ByteStringRange) ois.readObject();
assertThat(actual).isEqualTo(expected);
}
use of com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange in project java-bigtable by googleapis.
the class RangeTest method byteStringOfStringTest.
@Test
public void byteStringOfStringTest() {
ByteStringRange range = ByteStringRange.create("a", "b");
assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED);
assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("a"));
assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN);
assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("b"));
}
Aggregations