use of com.google.cloud.spanner.pgadapter.parsers.BinaryParser in project pgadapter by GoogleCloudPlatform.
the class ParserTest method testBinaryParsing.
@Test
public void testBinaryParsing() {
ByteArray value = ByteArray.copyFrom(new byte[] { (byte) 0b01010101, (byte) 0b10101010 });
byte[] byteResult = { (byte) 0b01010101, (byte) 0b10101010 };
byte[] stringResult = { 'U', '\\', '2', '5', '2' };
Parser parsedValue = new BinaryParser(value);
validate(parsedValue, byteResult, stringResult, byteResult);
validateCreateBinary(byteResult, Oid.BYTEA, value);
validateCreateText(stringResult, Oid.BYTEA, value);
}
Aggregations