Back to Fresco

PooledByteStreams

docs/javadoc/reference/com/facebook/common/memory/PooledByteStreams.html

3.6.012.9 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Exceptions

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

PooledByteStreams

extends Object

| java.lang.Object | | ↳ | com.facebook.common.memory.PooledByteStreams |

Class Overview

Helper class for interacting with java streams, similar to guava's ByteSteams. To prevent numerous allocations of temp buffers pool of byte arrays is used.

Summary

Public Constructors
Public Methods
long
Copy all bytes from InputStream to OutputStream.
long
Copy at most number of bytes from InputStream to OutputStream.

| [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 Constructors

public PooledByteStreams(ByteArrayPool byteArrayPool)

public PooledByteStreams(ByteArrayPool byteArrayPool, int tempBufSize)

Public Methods

public long copy(InputStream from, OutputStream to)

Copy all bytes from InputStream to OutputStream.

Parameters

| from | InputStream | | to | OutputStream |

Returns
  • number of copied bytes
Throws

| IOException | |

public long copy(InputStream from, OutputStream to, long bytesToCopy)

Copy at most number of bytes from InputStream to OutputStream.

Parameters

| from | InputStream | | to | OutputStream | | bytesToCopy | bytes to copy |

Returns
  • number of copied bytes
Throws

| IOException | |

+Generated by Doclava. +