/** * Returns the hex string representing the binary value. */ @Override public String toString() { return PropertiesUtils.toHex(bytes); }
/** * Returns the hex string representing the binary value. */ @Override public String toString() { return PropertiesUtils.toHex(bytes); }
@Test public void testXmlParseBOM() throws Exception { String sql = "select xmlparse(content X'EFBBBF" + PropertiesUtils.toHex("<a/>".getBytes("UTF-8")) + "')"; //$NON-NLS-1$ List<?>[] expected = new List<?>[] { Arrays.asList("<a/>") }; process(sql, expected); }
@Test public void testXmlTableBOM() throws Exception { String sql = "select * from xmltable('/a' passing xmlparse(document X'EFBBBF" + PropertiesUtils.toHex("<a/>".getBytes("UTF-8")) + "' wellformed)) as x"; //$NON-NLS-1$ List<?>[] expected = new List<?>[] { Arrays.asList("<a/>"), }; process(sql, expected); }
if (val != null) { Blob blob = GeometryUtils.geometryToEwkb((AbstractGeospatialType)rs.unwrap(ResultSetImpl.class).getRawCurrentValue()); String hexewkb = PropertiesUtils.toHex(blob.getBytes(1, (int) blob.length())); writer.write(hexewkb);
@Test public void testHashes() throws Exception { assertEquals("900150983CD24FB0D6963F7D28E17F72", PropertiesUtils.toHex(FunctionMethods.md5("abc").getBytesDirect())); assertEquals("A9993E364706816ABA3E25717850C26C9CD0D89D", PropertiesUtils.toHex(FunctionMethods.sha1("abc").getBytesDirect())); assertEquals("BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD", PropertiesUtils.toHex(FunctionMethods.sha2_256("abc").getBytesDirect())); assertEquals("DDAF35A193617ABACC417349AE20413112E6FA4E89A97EA20A9EEEE64B55D39A2192992A274FC1A836BA3C23A3FEEBBD454D4423643CE80E2A9AC94FA54CA49F", PropertiesUtils.toHex(FunctionMethods.sha2_512("abc").getBytesDirect())); }