Back to Fresco

Files

docs/javadoc/reference/com/facebook/common/internal/Files.html

3.6.011.8 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Methods | Inherited Methods | [Expand All]

public class

Files

extends Object

| java.lang.Object | | ↳ | com.facebook.common.internal.Files |

Class Overview

Provides utility methods for working with files.

All method parameters must be non-null unless documented otherwise.

Summary

Public Methods
static byte[]
Reads all bytes from a file into a byte array.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Methods

public static byte[] toByteArray(File file)

Reads all bytes from a file into a byte array.

Parameters

| file | the file to read from |

Returns
  • a byte array containing all the bytes from file
Throws

| IllegalArgumentException | if the file is bigger than the largest possible byte array (2^31 - 1) | | IOException | if an I/O error occurs |

+Generated by Doclava. +