public class

ForwardingExtractorInput

extends java.lang.Object

implements ExtractorInput

 java.lang.Object

↳androidx.media3.extractor.ForwardingExtractorInput

Gradle dependencies

compile group: 'androidx.media3', name: 'media3-extractor', version: '1.0.0-alpha03'

  • groupId: androidx.media3
  • artifactId: media3-extractor
  • version: 1.0.0-alpha03

Artifact androidx.media3:media3-extractor:1.0.0-alpha03 it located at Google repository (https://maven.google.com/)

Overview

An overridable ExtractorInput implementation forwarding all methods to another input.

Summary

Constructors
publicForwardingExtractorInput(ExtractorInput input)

Methods
public voidadvancePeekPosition(int length)

public booleanadvancePeekPosition(int length, boolean allowEndOfInput)

public longgetLength()

public longgetPeekPosition()

public longgetPosition()

public intpeek(byte[] target[], int offset, int length)

public voidpeekFully(byte[] target[], int offset, int length)

public booleanpeekFully(byte[] target[], int offset, int length, boolean allowEndOfInput)

public intread(byte[] buffer[], int offset, int length)

public voidreadFully(byte[] target[], int offset, int length)

public booleanreadFully(byte[] target[], int offset, int length, boolean allowEndOfInput)

public voidresetPeekPosition()

public voidsetRetryPosition(long position, java.lang.Throwable e)

public intskip(int length)

public voidskipFully(int length)

public booleanskipFully(int length, boolean allowEndOfInput)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public ForwardingExtractorInput(ExtractorInput input)

Methods

public int read(byte[] buffer[], int offset, int length)

public boolean readFully(byte[] target[], int offset, int length, boolean allowEndOfInput)

public void readFully(byte[] target[], int offset, int length)

public int skip(int length)

public boolean skipFully(int length, boolean allowEndOfInput)

public void skipFully(int length)

public int peek(byte[] target[], int offset, int length)

public boolean peekFully(byte[] target[], int offset, int length, boolean allowEndOfInput)

public void peekFully(byte[] target[], int offset, int length)

public boolean advancePeekPosition(int length, boolean allowEndOfInput)

public void advancePeekPosition(int length)

public void resetPeekPosition()

public long getPeekPosition()

public long getPosition()

public long getLength()

public void setRetryPosition(long position, java.lang.Throwable e)

Source

/*
 * Copyright 2020 The Android Open Source Project
 *
 * 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
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.media3.extractor;

import androidx.media3.common.util.UnstableApi;
import java.io.IOException;

/** An overridable {@link ExtractorInput} implementation forwarding all methods to another input. */
@UnstableApi
public class ForwardingExtractorInput implements ExtractorInput {

  private final ExtractorInput input;

  public ForwardingExtractorInput(ExtractorInput input) {
    this.input = input;
  }

  @Override
  public int read(byte[] buffer, int offset, int length) throws IOException {
    return input.read(buffer, offset, length);
  }

  @Override
  public boolean readFully(byte[] target, int offset, int length, boolean allowEndOfInput)
      throws IOException {
    return input.readFully(target, offset, length, allowEndOfInput);
  }

  @Override
  public void readFully(byte[] target, int offset, int length) throws IOException {
    input.readFully(target, offset, length);
  }

  @Override
  public int skip(int length) throws IOException {
    return input.skip(length);
  }

  @Override
  public boolean skipFully(int length, boolean allowEndOfInput) throws IOException {
    return input.skipFully(length, allowEndOfInput);
  }

  @Override
  public void skipFully(int length) throws IOException {
    input.skipFully(length);
  }

  @Override
  public int peek(byte[] target, int offset, int length) throws IOException {
    return input.peek(target, offset, length);
  }

  @Override
  public boolean peekFully(byte[] target, int offset, int length, boolean allowEndOfInput)
      throws IOException {
    return input.peekFully(target, offset, length, allowEndOfInput);
  }

  @Override
  public void peekFully(byte[] target, int offset, int length) throws IOException {
    input.peekFully(target, offset, length);
  }

  @Override
  public boolean advancePeekPosition(int length, boolean allowEndOfInput) throws IOException {
    return input.advancePeekPosition(length, allowEndOfInput);
  }

  @Override
  public void advancePeekPosition(int length) throws IOException {
    input.advancePeekPosition(length);
  }

  @Override
  public void resetPeekPosition() {
    input.resetPeekPosition();
  }

  @Override
  public long getPeekPosition() {
    return input.getPeekPosition();
  }

  @Override
  public long getPosition() {
    return input.getPosition();
  }

  @Override
  public long getLength() {
    return input.getLength();
  }

  @Override
  public <E extends Throwable> void setRetryPosition(long position, E e) throws E {
    input.setRetryPosition(position, e);
  }
}