Tabnine Logo
BufferPool$ByteBufferFactory
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using com.mucommander.commons.io.BufferPool$ByteBufferFactory (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

Javadoc

This class is a BufferFactory implementation for java.nio.ByteBuffer buffers. ByteBuffer instances created by #newBuffer(int) are direct ; the actually Class of those instances may be actually be java.nio.DirectByteBuffer and not java.nio.ByteBuffer as returned by #getBufferClass().

Most used methods

  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Notification (javax.management)
  • JComboBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Github Copilot 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