docs/javadoc/reference/com/facebook/imagepipeline/memory/SharedByteArray.html
|
|
Summary: Ctors | Methods | Inherited Methods | [Expand All]
public class
extends Object
implements MemoryTrimmable
| java.lang.Object | | ↳ | com.facebook.imagepipeline.memory.SharedByteArray |
Maintains a shareable reference to a byte array.
When accessing the shared array proper synchronization is guaranteed. Under hood the get method acquires an exclusive lock, which is released whenever the returned CloseableReference is closed.
If the currently available byte array is too small for a request it is replaced with a bigger one.
This class will also release the byte array if it is unused and collecting it can prevent an OOM.
| Public Constructors |
|---|
| Public Methods |
|---|
| CloseableReference<byte[]> |
| Get exclusive access to the byte array of size greater or equal to the passed one. |
| void |
| Responds to memory pressure by simply 'discarding' the local byte array if it is not used at the moment. |
| [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() |
| | From interface com.facebook.common.memory.MemoryTrimmable
| abstract void | trim(MemoryTrimType trimType) Trim memory. |
|
Get exclusive access to the byte array of size greater or equal to the passed one.
Under the hood this method acquires an exclusive lock that is released when the returned reference is closed.
Responds to memory pressure by simply 'discarding' the local byte array if it is not used at the moment.
| trimType | kind of trimming to perform (ignored) |
+Generated by Doclava. +