diff --git a/library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java b/library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java index 6724e283fb..8a9471c113 100644 --- a/library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java +++ b/library/src/main/java/com/google/android/exoplayer/chunk/Chunk.java @@ -134,18 +134,6 @@ public abstract class Chunk implements Loadable { consumeStream(dataSourceStream); } - /** - * Returns a byte array containing the loaded data. If the chunk is partially loaded, this - * method returns the data that has been loaded so far. If nothing has been loaded, null is - * returned. - * - * @return The loaded data or null. - */ - public final byte[] getLoadedData() { - Assertions.checkState(dataSourceStream != null); - return dataSourceStream.getLoadedData(); - } - /** * Invoked by {@link #consume()}. Implementations may override this method if they wish to * consume the loaded data at this point. diff --git a/library/src/main/java/com/google/android/exoplayer/chunk/SingleSampleMediaChunk.java b/library/src/main/java/com/google/android/exoplayer/chunk/SingleSampleMediaChunk.java index dfe0d71584..e0b9f91ad0 100644 --- a/library/src/main/java/com/google/android/exoplayer/chunk/SingleSampleMediaChunk.java +++ b/library/src/main/java/com/google/android/exoplayer/chunk/SingleSampleMediaChunk.java @@ -64,10 +64,8 @@ public class SingleSampleMediaChunk extends MediaChunk { * @param nextChunkIndex The index of the next chunk, or -1 if this is the last chunk. * @param sampleFormat The format of the media contained by the chunk. * @param headerData Custom header data for the sample. May be null. If set, the header data is - * prepended to the sample data returned when {@link #read(SampleHolder)} is called. It is - * however not considered part of the loaded data, and so is not prepended to the data - * returned by {@link #getLoadedData()}. It is also not reflected in the values returned by - * {@link #bytesLoaded()} and {@link #getLength()}. + * prepended to the sample data returned when {@link #read(SampleHolder)} is called. It is not + * reflected in the values returned by {@link #bytesLoaded()} and {@link #getLength()}. */ public SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, Format format, int trigger, long startTimeUs, long endTimeUs, int nextChunkIndex, MediaFormat sampleFormat, diff --git a/library/src/main/java/com/google/android/exoplayer/upstream/DataSourceStream.java b/library/src/main/java/com/google/android/exoplayer/upstream/DataSourceStream.java index dc5227e426..5c4dcd65b2 100644 --- a/library/src/main/java/com/google/android/exoplayer/upstream/DataSourceStream.java +++ b/library/src/main/java/com/google/android/exoplayer/upstream/DataSourceStream.java @@ -119,26 +119,6 @@ public final class DataSourceStream implements Loadable, NonBlockingInputStream return resolvedLength != C.LENGTH_UNBOUNDED && loadPosition == resolvedLength; } - /** - * Returns a byte array containing the loaded data. If the data is partially loaded, this method - * returns the portion of the data that has been loaded so far. If nothing has been loaded, null - * is returned. This method does not use or update the current read position. - *

- * Note: The read methods provide a more efficient way of consuming the loaded data. Use this - * method only when a freshly allocated byte[] containing all of the loaded data is required. - * - * @return The loaded data, or null. - */ - public final byte[] getLoadedData() { - if (loadPosition == 0) { - return null; - } - - byte[] rawData = new byte[(int) loadPosition]; - read(null, rawData, 0, new ReadHead(), rawData.length); - return rawData; - } - // {@link NonBlockingInputStream} implementation. @Override