Skip to content

Commit 8ed5ec0

Browse files
committed
Release v1.3.3
Remove spurious throws from byte[] and String decodes
1 parent 7de0af4 commit 8ed5ec0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<attribute name="Class-Path" value="${manifest_cp}"/>
4141
<attribute name="Implementation-Vendor" value="io.ipfs"/>
4242
<attribute name="Implementation-Title" value="multihash"/>
43-
<attribute name="Implementation-Version" value="1.3.2"/>
43+
<attribute name="Implementation-Version" value="1.3.3"/>
4444
</manifest>
4545
</jar>
4646
</target>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.github.multiformats</groupId>
66
<artifactId>java-multihash</artifactId>
7-
<version>v1.3.2</version>
7+
<version>v1.3.3</version>
88
<packaging>jar</packaging>
99

1010
<name>multihash</name>

src/main/java/io/ipfs/multihash/Multihash.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,12 @@ public static Multihash deserialize(InputStream din) throws IOException {
214214
return new Multihash(t, hash);
215215
}
216216

217-
public static Multihash deserialize(byte[] raw) throws IOException {
218-
return deserialize(new ByteArrayInputStream(raw));
217+
public static Multihash deserialize(byte[] raw) {
218+
try {
219+
return deserialize(new ByteArrayInputStream(raw));
220+
} catch (IOException e) {
221+
throw new RuntimeException(e);
222+
}
219223
}
220224

221225
/**
@@ -224,7 +228,7 @@ public static Multihash deserialize(byte[] raw) throws IOException {
224228
* @return
225229
* @throws IOException
226230
*/
227-
public static Multihash decode(String encoded) throws IOException {
231+
public static Multihash decode(String encoded) {
228232
if (encoded.length() == 46 && encoded.startsWith("Qm"))
229233
return deserialize(Base58.decode(encoded));
230234
return deserialize(Multibase.decode(encoded));
@@ -269,11 +273,7 @@ public static Multihash fromHex(String hex) {
269273
}
270274

271275
public static Multihash fromBase58(String base58) {
272-
try {
273-
return Multihash.deserialize(Base58.decode(base58));
274-
} catch (IOException e) {
275-
throw new RuntimeException(e);
276-
}
276+
return Multihash.deserialize(Base58.decode(base58));
277277
}
278278

279279
public static long readVarint(InputStream in) throws IOException {

0 commit comments

Comments
 (0)