-
- All Implemented Interfaces:
-
com.facebook.common.memory.PooledByteBufferFactory
@ThreadSafe() public final class MemoryPooledByteBufferFactory implements PooledByteBufferFactoryA factory to provide instances of MemoryPooledByteBuffer and MemoryPooledByteBufferOutputStream
-
-
Constructor Summary
Constructors Constructor Description MemoryPooledByteBufferFactory(MemoryChunkPool pool, PooledByteStreams pooledByteStreams)
-
Method Summary
Modifier and Type Method Description MemoryPooledByteBuffernewByteBuffer(Integer size)MemoryPooledByteBuffernewByteBuffer(InputStream inputStream)MemoryPooledByteBuffernewByteBuffer(ByteArray bytes)MemoryPooledByteBuffernewByteBuffer(InputStream inputStream, Integer initialCapacity)final MemoryPooledByteBuffernewByteBuf(InputStream inputStream, MemoryPooledByteBufferOutputStream outputStream)Reads all bytes from inputStream and writes them to outputStream. MemoryPooledByteBufferOutputStreamnewOutputStream()MemoryPooledByteBufferOutputStreamnewOutputStream(Integer initialCapacity)-
-
Constructor Detail
-
MemoryPooledByteBufferFactory
MemoryPooledByteBufferFactory(MemoryChunkPool pool, PooledByteStreams pooledByteStreams)
-
-
Method Detail
-
newByteBuffer
MemoryPooledByteBuffer newByteBuffer(Integer size)
-
newByteBuffer
MemoryPooledByteBuffer newByteBuffer(InputStream inputStream)
-
newByteBuffer
MemoryPooledByteBuffer newByteBuffer(ByteArray bytes)
-
newByteBuffer
MemoryPooledByteBuffer newByteBuffer(InputStream inputStream, Integer initialCapacity)
-
newByteBuf
final MemoryPooledByteBuffer newByteBuf(InputStream inputStream, MemoryPooledByteBufferOutputStream outputStream)
Reads all bytes from inputStream and writes them to outputStream. When all bytes are read outputStream.toByteBuffer is called and obtained MemoryPooledByteBuffer is returned
- Parameters:
inputStream- the input stream to read fromoutputStream- output stream used to transform content of input stream to MemoryPooledByteBuffer
-
newOutputStream
MemoryPooledByteBufferOutputStream newOutputStream()
-
newOutputStream
MemoryPooledByteBufferOutputStream newOutputStream(Integer initialCapacity)
-
-
-
-