public class

WriterCallbacks

extends Object
java.lang.Object
   ↳ com.facebook.cache.common.WriterCallbacks

Class Overview

Utility class to create typical WriterCallbacks.

Summary

Public Constructors
WriterCallbacks()
Public Methods
static WriterCallback from(InputStream is)
Creates a writer callback that copies all the content read from an InputStream into the target stream.
static WriterCallback from(byte[] data)
Creates a writer callback that writes some byte array to the target stream.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WriterCallbacks ()

Public Methods

public static WriterCallback from (InputStream is)

Creates a writer callback that copies all the content read from an InputStream into the target stream.

This writer can be used only once.

Parameters
is the source
Returns
  • the writer callback

public static WriterCallback from (byte[] data)

Creates a writer callback that writes some byte array to the target stream.

This writer can be used many times.

Parameters
data the bytes to write
Returns
  • the writer callback