Skip to content

Commit fc14e7d

Browse files
committed
Skip unnecessary string instantiation on bytea parsing (thanks to @gmokki).
1 parent 602efb4 commit fc14e7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/github/pgasync/impl/conversion/BlobConversions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static byte[] toBytes(Oid oid, byte[] value) {
1717
switch (oid) {
1818
case UNSPECIFIED: // fallthrough
1919
case BYTEA:
20-
return parseHexBinary(new String(value, UTF_8).substring(2));
20+
return parseHexBinary(new String(value, 2, value.length - 2, UTF_8));
2121
default:
2222
throw new SqlException("Unsupported conversion " + oid.name() + " -> byte[]");
2323
}

0 commit comments

Comments
 (0)