Skip to content

Commit

Permalink
* Make public the Pointer.formatBytes() and Pointer.parseBytes()
Browse files Browse the repository at this point in the history
… static methods
  • Loading branch information
saudet committed Jul 1, 2017
1 parent f105e88 commit c4fa2c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

* Use `Integer.decode()` instead of `parseInt()` on integer literals and support hexadecimal as well as octal numbers
* Make public the `Pointer.formatBytes()` and `Pointer.parseBytes()` static methods
* Use `Integer.decode()` instead of `parseInt()` on integer literals to support hexadecimal and octal numbers
* Add `Builder.encoding` option to let users specify I/O character set name ([issue bytedeco/javacpp-presets#195](https://github.com/bytedeco/javacpp-presets/issues/195))
* Prevent race condition that could occur in `Loader.cacheResource()` ([pull #188](https://github.com/bytedeco/javacpp/pull/188))
* Fix potential compile errors with Android caused by superfluous `typedef` from `Generator` ([issue #186](https://github.com/bytedeco/javacpp/issues/186))
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/bytedeco/javacpp/Pointer.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static class DeallocatorThread extends Thread {
* by a call to {@code Thread.sleep(100)}. */
static final int maxRetries;

static String formatBytes(long bytes) {
public static String formatBytes(long bytes) {
if (bytes < 1024L) {
return bytes + "";
} else if ((bytes /= 1024L) < 1024L) {
Expand All @@ -342,7 +342,7 @@ static String formatBytes(long bytes) {
}
}

static long parseBytes(String string) throws NumberFormatException {
public static long parseBytes(String string) throws NumberFormatException {
int i = 0;
while (i < string.length()) {
if (!Character.isDigit(string.charAt(i))) {
Expand Down

0 comments on commit c4fa2c1

Please sign in to comment.