From 8ed5ec0e6b63515e8697c9b7efee9e9578438ef5 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 31 Jan 2023 22:15:44 +0000 Subject: [PATCH] Release v1.3.3 Remove spurious throws from byte[] and String decodes --- build.xml | 2 +- pom.xml | 2 +- src/main/java/io/ipfs/multihash/Multihash.java | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.xml b/build.xml index b1cea92..2168f0a 100644 --- a/build.xml +++ b/build.xml @@ -40,7 +40,7 @@ - + diff --git a/pom.xml b/pom.xml index ee73170..c58b1ba 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.multiformats java-multihash - v1.3.2 + v1.3.3 jar multihash diff --git a/src/main/java/io/ipfs/multihash/Multihash.java b/src/main/java/io/ipfs/multihash/Multihash.java index d66b43b..26fd86f 100644 --- a/src/main/java/io/ipfs/multihash/Multihash.java +++ b/src/main/java/io/ipfs/multihash/Multihash.java @@ -214,8 +214,12 @@ public static Multihash deserialize(InputStream din) throws IOException { return new Multihash(t, hash); } - public static Multihash deserialize(byte[] raw) throws IOException { - return deserialize(new ByteArrayInputStream(raw)); + public static Multihash deserialize(byte[] raw) { + try { + return deserialize(new ByteArrayInputStream(raw)); + } catch (IOException e) { + throw new RuntimeException(e); + } } /** @@ -224,7 +228,7 @@ public static Multihash deserialize(byte[] raw) throws IOException { * @return * @throws IOException */ - public static Multihash decode(String encoded) throws IOException { + public static Multihash decode(String encoded) { if (encoded.length() == 46 && encoded.startsWith("Qm")) return deserialize(Base58.decode(encoded)); return deserialize(Multibase.decode(encoded)); @@ -269,11 +273,7 @@ public static Multihash fromHex(String hex) { } public static Multihash fromBase58(String base58) { - try { - return Multihash.deserialize(Base58.decode(base58)); - } catch (IOException e) { - throw new RuntimeException(e); - } + return Multihash.deserialize(Base58.decode(base58)); } public static long readVarint(InputStream in) throws IOException {