Skip to content

Commit d6879d2

Browse files
authored
Update README.md
1 parent 70b39d4 commit d6879d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ Then run commands like:
6464
ipfs.refs.local();
6565
```
6666

67-
To add a file use:
67+
To add a file use (the add method returns a list of merklenodes, in this case there is only one element):
6868
```Java
6969
NamedStreamable.FileWrapper file = new NamedStreamable.FileWrapper(new File("hello.txt"));
70-
MerkleNode addResult = ipfs.add(file);
70+
MerkleNode addResult = ipfs.add(file).get(0);
7171
```
7272

7373
To add a byte[] use:
7474
```Java
7575
NamedStreamable.ByteArrayWrapper file = new NamedStreamable.ByteArrayWrapper("hello.txt", "G'day world! IPFS rocks!".getBytes());
76-
MerkleNode addResult = ipfs.add(file);
76+
MerkleNode addResult = ipfs.add(file).get(0);
7777
```
7878

7979
To get a file use:

0 commit comments

Comments
 (0)