Skip to content

Commit 5bfd46f

Browse files
authored
Update README.md
fixed indent
1 parent e709760 commit 5bfd46f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,24 @@ to convert an array of doubles to a base64 string we use these example methods:
4949
**Java**
5050
```
5151
public static final String convertArrayToBase64(double[] array) {
52-
final int capacity = 8 * array.length;
53-
final ByteBuffer bb = ByteBuffer.allocate(capacity);
54-
for (int i = 0; i < array.length; i++) {
55-
bb.putDouble(array[i]);
56-
}
57-
bb.rewind();
58-
final ByteBuffer encodedBB = Base64.getEncoder().encode(bb);
59-
return new String(encodedBB.array());
52+
final int capacity = 8 * array.length;
53+
final ByteBuffer bb = ByteBuffer.allocate(capacity);
54+
for (int i = 0; i < array.length; i++) {
55+
bb.putDouble(array[i]);
6056
}
57+
bb.rewind();
58+
final ByteBuffer encodedBB = Base64.getEncoder().encode(bb);
59+
return new String(encodedBB.array());
60+
}
6161
62-
public static double[] convertBase64ToArray(String base64Str) {
63-
final byte[] decode = Base64.getDecoder().decode(base64Str.getBytes());
64-
final DoubleBuffer doubleBuffer = ByteBuffer.wrap(decode).asDoubleBuffer();
62+
public static double[] convertBase64ToArray(String base64Str) {
63+
final byte[] decode = Base64.getDecoder().decode(base64Str.getBytes());
64+
final DoubleBuffer doubleBuffer = ByteBuffer.wrap(decode).asDoubleBuffer();
6565
66-
final double[] dims = new double[doubleBuffer.capacity()];
67-
doubleBuffer.get(dims);
68-
return dims;
69-
}
66+
final double[] dims = new double[doubleBuffer.capacity()];
67+
doubleBuffer.get(dims);
68+
return dims;
69+
}
7070
```
7171
**Python**
7272
```

0 commit comments

Comments
 (0)