congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CompositeBuffer.hasRemaining
Code IndexAdd Tabnine to your IDE (free)

How to use
hasRemaining
method
in
org.glassfish.grizzly.memory.CompositeBuffer

Best Java code snippets using org.glassfish.grizzly.memory.CompositeBuffer.hasRemaining (Showing top 10 results out of 315)

origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: org.glassfish.grizzly/grizzly-websockets-server

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: org.glassfish.grizzly/grizzly-http-server-core

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: org.glassfish.grizzly/grizzly-http

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
origin: javaee/grizzly

private boolean flushBinaryBuffers(final boolean isLast)
    throws IOException {
  if (!outputHeader.isChunkingAllowed()
      && outputHeader.getContentLength() == -1) {
    if (!isLast) {
      return false;
    } else {
      outputHeader.setContentLength(getBufferedDataSize());
    }
  }
  final Buffer bufferToFlush;
  final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining();
  if (isFlushComposite) {
    finishCurrentBuffer();
    bufferToFlush = compositeBuffer;
    compositeBuffer = null;
  } else if (currentBuffer != null && currentBuffer.position() > 0) {
    currentBuffer.trim();
    bufferToFlush = currentBuffer;
    currentBuffer = null;
  } else {
    bufferToFlush = null;
  }
  if (bufferToFlush != null || isLast) {
    doCommit();
    flushBuffer(bufferToFlush, isLast, null);
    return true;
  }
  return false;
}
org.glassfish.grizzly.memoryCompositeBufferhasRemaining

Popular methods of CompositeBuffer

  • append
  • allowInternalBuffersDispose
  • newBuffer
  • remaining
  • allowBufferDispose
  • dispose
  • shrink
  • get
  • position
  • bulk
    Iterates over Buffer bytes from position to limit and lets BulkOperation examine/change the buffer c
  • disposeOrder
    Sets the order in which internal Buffers will be disposed.
  • limit
  • disposeOrder,
  • limit,
  • replace,
  • toByteBufferArray,
  • clear,
  • duplicate,
  • order,
  • prepend,
  • removeAll,
  • toBufferArray

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Kernel (java.awt.image)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ImageIO (javax.imageio)
  • JOptionPane (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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