congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WrapperAware
Code IndexAdd Tabnine to your IDE (free)

How to use
WrapperAware
in
org.glassfish.grizzly.memory

Best Java code snippets using org.glassfish.grizzly.memory.WrapperAware (Showing top 20 results out of 315)

origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: org.mule.glassfish.grizzly/grizzly-framework

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * Returns {@link Buffer}, which wraps the {@link ByteBuffer}.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param byteBuffer {@link ByteBuffer} to wrap
 *
 * @return {@link Buffer} wrapper on top of passed {@link ByteBuffer}.
 */
public static Buffer wrap(final MemoryManager memoryManager,
    final ByteBuffer byteBuffer) {
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(byteBuffer);
  } else if (byteBuffer.hasArray()) {
    return wrap(memoryManager, byteBuffer.array(),
        byteBuffer.arrayOffset() + byteBuffer.position(),
        byteBuffer.remaining());
  }
  throw new IllegalStateException("Can not wrap ByteBuffer");
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: org.mule.glassfish.grizzly/grizzly-framework

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
origin: javaee/grizzly

/**
 * Returns {@link Buffer}, which wraps the part of byte array with
 * specific offset and length.
 *
 * @param memoryManager {@link MemoryManager}, which should be
 *                       used for wrapping.
 * @param array byte array to wrap
 * @param offset byte buffer offset
 * @param length byte buffer length
 *
 * @return {@link Buffer} wrapper on top of passed byte array.
 */
public static Buffer wrap(MemoryManager memoryManager,
    final byte[] array, final int offset, final int length) {
  if (memoryManager == null) {
    memoryManager = getDefaultMemoryManager();
  }
  if (memoryManager instanceof WrapperAware) {
    return ((WrapperAware) memoryManager).wrap(array, offset, length);
  }
  final Buffer buffer = memoryManager.allocate(length);
  buffer.put(array, offset, length);
  buffer.flip();
  return buffer;
}
org.glassfish.grizzly.memoryWrapperAware

Javadoc

MemoryManagers, which implement this interface, are able to convert frequently used Java buffer types to Grizzly Buffer.

Most used methods

  • wrap
    Returns Buffer, which wraps the part of byte array with specific offset and length.

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • setContentView (Activity)
  • getSystemService (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
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