Commit 31a839c8 by olly Committed by Christos Tsilopoulos

Move non-player specific classes to common

These will all be needed in common to break dependencies
between decoder extension modules and the core module.

PiperOrigin-RevId: 389871983
parent b4e99304
......@@ -40,9 +40,9 @@ public abstract class SimpleDecoder<
private int availableInputBufferCount;
private int availableOutputBufferCount;
private I dequeuedInputBuffer;
@Nullable private I dequeuedInputBuffer;
private E exception;
@Nullable private E exception;
private boolean flushed;
private boolean released;
private int skippedOutputBufferCount;
......@@ -51,6 +51,7 @@ public abstract class SimpleDecoder<
* @param inputBuffers An array of nulls that will be used to store references to input buffers.
* @param outputBuffers An array of nulls that will be used to store references to output buffers.
*/
@SuppressWarnings("nullness:method.invocation")
protected SimpleDecoder(I[] inputBuffers, O[] outputBuffers) {
lock = new Object();
queuedInputBuffers = new ArrayDeque<>();
......@@ -178,6 +179,7 @@ public abstract class SimpleDecoder<
* @throws E The decode exception.
*/
private void maybeThrowException() throws E {
@Nullable E exception = this.exception;
if (exception != null) {
throw exception;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment