This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <V> Callable<V> createCallable(Consumer<Callback<V>> callbackConsumer) { | |
return new Callable<V>() { | |
private final CountDownLatch countDownLatch = new CountDownLatch(1); | |
private V result; | |
private Throwable error; | |
public void callbackDone(V result, Throwable error) { | |
this.result = result; | |
this.error = error; | |
countDownLatch.countDown(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2011 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteOrder; | |
import java.util.Arrays; | |
import java.util.StringJoiner; | |
/** | |
* This class provides a "nibble" array. A nibble is a number stored on less | |
* than 8 bits. | |
* | |
* @author Wytrem (4th August 2016) |