Tabnine Logo
BufferPool$ByteBufferFactory.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.mucommander.commons.io.BufferPool$ByteBufferFactory
constructor

Best Java code snippets using com.mucommander.commons.io.BufferPool$ByteBufferFactory.<init> (Showing top 3 results out of 315)

origin: mucommander/mucommander

/**
 * Tests <code>BufferPool</code> with <code>ByteBuffer</code> buffers.
 *
 * <p>This method invokes {@link #testBuffer(com.mucommander.commons.io.BufferPool.BufferFactory)} with a
 * {@link BufferPool.ByteBufferFactory} instance.</p>
 */
@Test
public void testByteBuffer() {
  testBuffer(new BufferPool.ByteBufferFactory());
}
origin: mucommander/mucommander

/**
 * Returns a ByteBuffer of the specified capacity. This method first checks if a ByteBuffer instance of the
 * specified capacity exists in the pool. If one is found, it is removed from the pool and returned. If not,
 * a new instance is created and returned.
 *
 * <p>This method won't return the same buffer instance until it has been released with
 * {@link #releaseByteBuffer(ByteBuffer)}.</p>
 *
 * <p>This method is a shorthand for {@link #getBuffer(com.mucommander.commons.io.BufferPool.BufferFactory,int)} called
 * with a {@link com.mucommander.commons.io.BufferPool.ByteBufferFactory} instance.</p>.
 * @param capacity capacity of the ByteBuffer
 * @return a ByteBuffer with the specified capacity
 */
public static synchronized ByteBuffer getByteBuffer(int capacity) {
  return (ByteBuffer)getBuffer(new ByteBufferFactory(), capacity);
}
origin: mucommander/mucommander

/**
 * Makes the given buffer available for further calls to {@link #getByteBuffer(int)} with the same buffer capacity.
 * Returns <code>true</code> if the buffer was added to the pool, <code>false</code> if the buffer was already in
 * the pool.
 *
 * <p>After calling this method, the given buffer instance <b>must not be used</b>, otherwise it could get
 * corrupted if other threads were using it.</p>
 *
 * @param buffer the buffer instance to make available for further use
 * @return <code>true</code> if the buffer was added to the pool, <code>false</code> if the buffer was already in the pool
 * @throws IllegalArgumentException if specified buffer is null
 */
public static synchronized boolean releaseByteBuffer(ByteBuffer buffer) {
  return releaseBuffer(buffer, new ByteBufferFactory());
}
com.mucommander.commons.ioBufferPool$ByteBufferFactory<init>

Popular methods of BufferPool$ByteBufferFactory

    Popular in Java

    • Reactive rest calls using spring rest template
    • notifyDataSetChanged (ArrayAdapter)
    • getApplicationContext (Context)
    • getSystemService (Context)
    • PrintStream (java.io)
      Fake signature of an existing Java class.
    • Thread (java.lang)
      A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
    • NumberFormat (java.text)
      The abstract base class for all number formats. This class provides the interface for formatting and
    • BitSet (java.util)
      The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
    • Collection (java.util)
      Collection is the root of the collection hierarchy. It defines operations on data collections and t
    • ThreadPoolExecutor (java.util.concurrent)
      An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
    • CodeWhisperer alternatives
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now