Tabnine Logo
TCPNIOUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
TCPNIOUtils
in
org.glassfish.grizzly.nio.transport

Best Java code snippets using org.glassfish.grizzly.nio.transport.TCPNIOUtils (Showing top 20 results out of 315)

origin: javaee/grizzly

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}
origin: org.mule.glassfish.grizzly/grizzly-framework

public static int writeCompositeBuffer(final TCPNIOConnection connection,
    final CompositeBuffer buffer) throws IOException {
  final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
    fill(bufferArray, bufferSize, ioRecord);
    ioRecord.finishBufferSlice();
        ? flushByteBuffers(socketChannel, ioRecord.getArray(), 0, arraySize)
        : flushByteBuffer(socketChannel, ioRecord.getArray()[0]);
origin: javaee/grizzly

  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  directByteBuffer.position(pos);
final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
buffer.limit(oldPos + bufferSize);
    DirectByteBufferRecord.get();
final ByteBuffer directByteBuffer = ioRecord.allocate(bufferSize);
fill(buffer, bufferSize, directByteBuffer);
  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  ioRecord.release();
origin: javaee/grizzly

TCPNIOUtils.writeCompositeBuffer(connection,
  (CompositeBuffer) buffer) :
TCPNIOUtils.writeSimpleBuffer(connection, buffer);
origin: org.glassfish.grizzly/grizzly-websockets-server

if (isAllocate) {
  try {
    buffer = TCPNIOUtils.allocateAndReadBuffer(tcpConnection);
    read = buffer.position();
    tcpConnection.onRead(buffer, read);
  if (buffer.hasRemaining()) {
    try {
      read = TCPNIOUtils.readBuffer(tcpConnection, buffer);
    } catch (Exception e) {
      if (LOGGER.isLoggable(Level.FINE)) {
origin: javaee/grizzly

  read = readSimpleByteBuffer(connection, directByteBuffer);
  if (read > 0) {
    directByteBuffer.flip();
read = readBuffer(connection, buffer);
origin: javaee/grizzly

TCPNIOUtils.flushByteBuffer(
socketChannel, directByteBufferRecord.getArray()[0]) :
TCPNIOUtils.flushByteBuffers(
socketChannel, directByteBufferRecord.getArray(), 0, arraySize) ;
origin: javaee/grizzly

TCPNIOUtils.fill(bufferArray, totalRemaining, ioRecord);
origin: javaee/grizzly

public static int writeCompositeBuffer(final TCPNIOConnection connection,
    final CompositeBuffer buffer) throws IOException {
  final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
    fill(bufferArray, bufferSize, ioRecord);
    ioRecord.finishBufferSlice();
        ? flushByteBuffers(socketChannel, ioRecord.getArray(), 0, arraySize)
        : flushByteBuffer(socketChannel, ioRecord.getArray()[0]);
origin: org.glassfish.grizzly/grizzly-core

  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  directByteBuffer.position(pos);
final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
buffer.limit(oldPos + bufferSize);
    DirectByteBufferRecord.get();
final ByteBuffer directByteBuffer = ioRecord.allocate(bufferSize);
fill(buffer, bufferSize, directByteBuffer);
  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  ioRecord.release();
origin: org.glassfish.grizzly/grizzly-websockets-server

TCPNIOUtils.writeCompositeBuffer(connection,
  (CompositeBuffer) buffer) :
TCPNIOUtils.writeSimpleBuffer(connection, buffer);
origin: org.glassfish.grizzly/grizzly-core

if (isAllocate) {
  try {
    buffer = TCPNIOUtils.allocateAndReadBuffer(tcpConnection);
    read = buffer.position();
    tcpConnection.onRead(buffer, read);
  if (buffer.hasRemaining()) {
    try {
      read = TCPNIOUtils.readBuffer(tcpConnection, buffer);
    } catch (Exception e) {
      if (LOGGER.isLoggable(Level.FINE)) {
origin: javaee/grizzly

  read = readSimpleByteBuffer(connection, directByteBuffer);
  if (read > 0) {
    directByteBuffer.flip();
read = readBuffer(connection, buffer);
origin: org.glassfish.grizzly/grizzly-websockets-server

TCPNIOUtils.flushByteBuffer(
socketChannel, directByteBufferRecord.getArray()[0]) :
TCPNIOUtils.flushByteBuffers(
socketChannel, directByteBufferRecord.getArray(), 0, arraySize) ;
origin: org.glassfish.grizzly/grizzly-websockets-server

TCPNIOUtils.fill(bufferArray, totalRemaining, ioRecord);
origin: org.glassfish.grizzly/grizzly-http-server-core

public static int writeCompositeBuffer(final TCPNIOConnection connection,
    final CompositeBuffer buffer) throws IOException {
  final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
    fill(bufferArray, bufferSize, ioRecord);
    ioRecord.finishBufferSlice();
        ? flushByteBuffers(socketChannel, ioRecord.getArray(), 0, arraySize)
        : flushByteBuffer(socketChannel, ioRecord.getArray()[0]);
origin: javaee/grizzly

  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  directByteBuffer.position(pos);
final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
buffer.limit(oldPos + bufferSize);
    DirectByteBufferRecord.get();
final ByteBuffer directByteBuffer = ioRecord.allocate(bufferSize);
fill(buffer, bufferSize, directByteBuffer);
  written = flushByteBuffer(socketChannel, directByteBuffer);
} finally {
  ioRecord.release();
origin: javaee/grizzly

TCPNIOUtils.writeCompositeBuffer(connection,
  (CompositeBuffer) buffer) :
TCPNIOUtils.writeSimpleBuffer(connection, buffer);
origin: javaee/grizzly

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}
origin: javaee/grizzly

if (isAllocate) {
  try {
    buffer = TCPNIOUtils.allocateAndReadBuffer(tcpConnection);
    read = buffer.position();
    tcpConnection.onRead(buffer, read);
  if (buffer.hasRemaining()) {
    try {
      read = TCPNIOUtils.readBuffer(tcpConnection, buffer);
    } catch (Exception e) {
      if (LOGGER.isLoggable(Level.FINE)) {
org.glassfish.grizzly.nio.transportTCPNIOUtils

Javadoc

TCP NIO Transport utils

Most used methods

  • allocateAndReadBuffer
  • calcWriteBufferSize
  • fill
  • flushByteBuffer
  • flushByteBuffers
  • readBuffer
  • readCompositeBuffer
  • readSimpleBuffer
  • readSimpleByteBuffer
  • writeCompositeBuffer
  • writeSimpleBuffer
  • writeSimpleBuffer

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JOptionPane (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 12 Jupyter Notebook extensions
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