Back to Fresco

PooledByteBufferInputStream

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

3.6.014.8 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Exceptions

Packages | Classes

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

public class

PooledByteBufferInputStream

extends InputStream

| java.lang.Object | | ↳ | java.io.InputStream | | | ↳ | com.facebook.common.memory.PooledByteBufferInputStream |

Class Overview

An InputStream implementation over a PooledByteBuffer instance

Summary

Public Constructors
Creates a new inputstream instance over the specific buffer.
Public Methods
int
Returns the number of bytes still available to read
void
Sets a mark position in this inputstream.
boolean
Returns true since this class supports mark(int) and reset() methods
int
int
Reads at most length bytes from this stream and stores them in byte array buffer starting at offset.
int
void
Resets this stream to the last marked location.
long
Skips byteCount (or however many bytes are available) bytes in the stream

| [Expand] Inherited Methods | | --- | | From class java.io.InputStream

| int | available() | | void | close() | | synchronized void | mark(int arg0) | | boolean | markSupported() | | abstract int | read() | | int | read(byte[] arg0, int arg1, int arg2) | | int | read(byte[] arg0) | | synchronized void | reset() | | long | skip(long arg0) |

| | 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() |

| | From interface java.io.Closeable

| abstract void | close() |

| | From interface java.lang.AutoCloseable

| abstract void | close() |

|

Public Constructors

public PooledByteBufferInputStream(PooledByteBuffer pooledByteBuffer)

Creates a new inputstream instance over the specific buffer.

Parameters

| pooledByteBuffer | the buffer to read from |

Public Methods

public int available()

Returns the number of bytes still available to read

public void mark(int readlimit)

Sets a mark position in this inputstream. The parameter readlimit is ignored. Sending reset() will reposition the stream back to the marked position.

Parameters

| readlimit | ignored. |

public boolean markSupported()

Returns true since this class supports mark(int) and reset() methods

public int read()

public int read(byte[] buffer, int offset, int length)

Reads at most length bytes from this stream and stores them in byte array buffer starting at offset.

Parameters

| buffer | the buffer to read data into | | offset | start offset in the buffer | | length | max number of bytes to read |

Returns
  • number of bytes read

public int read(byte[] buffer)

public void reset()

Resets this stream to the last marked location. This implementation resets the position to either the marked position, the start position supplied in the constructor or 0 if neither has been provided.

public long skip(long byteCount)

Skips byteCount (or however many bytes are available) bytes in the stream

Parameters

| byteCount | number of bytes to skip |

Returns
  • number of bytes actually skipped

+Generated by Doclava. +