• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.net.apihelpers;
6 
7 import org.chromium.net.UrlResponseInfo;
8 
9 /**
10  * A specialization of {@link InMemoryTransformCronetCallback} which returns the body bytes verbatim
11  * without any interpretation.
12  */
13 public abstract class ByteArrayCronetCallback extends InMemoryTransformCronetCallback<byte[]> {
14     @Override // Override to return the subtype
addCompletionListener( CronetRequestCompletionListener<? super byte[]> listener)15     public ByteArrayCronetCallback addCompletionListener(
16             CronetRequestCompletionListener<? super byte[]> listener) {
17         super.addCompletionListener(listener);
18         return this;
19     }
20 
21     @Override
transformBodyBytes(UrlResponseInfo info, byte[] bodyBytes)22     protected final byte[] transformBodyBytes(UrlResponseInfo info, byte[] bodyBytes) {
23         return bodyBytes;
24     }
25 }
26