Examples of remaining()


Examples of org.eclipse.jetty.http2.frames.DataFrame.remaining()

        public void succeeded()
        {
            flowControl.onDataSent(stream, length);
            // Do we have more to send ?
            DataFrame dataFrame = (DataFrame)frame;
            if (dataFrame.remaining() > 0)
            {
                // We have written part of the frame, but there is more to write.
                // We need to keep the correct ordering of frames, to avoid that other
                // frames for the same stream are written before this one is finished.
                flusher.prepend(this);
View Full Code Here

Examples of org.elasticsearch.cluster.routing.PlainShardIterator.remaining()

        assertThat(shardIterator.firstOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.nextOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.nextOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));

        shardIterator = new PlainShardIterator(new ShardId("test1", 0), ImmutableList.<ShardRouting>of(), 1);
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.firstOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardIterator.remaining()

@Test
public class RoutingIteratorTests {

    @Test public void testEmptyIterator() {
        ShardIterator shardIterator = new PlainShardIterator(new ShardId("test1", 0), ImmutableList.<ShardRouting>of(), 0);
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.firstOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.nextOrNull(), nullValue());
        assertThat(shardIterator.remaining(), equalTo(0));
        assertThat(shardIterator.nextOrNull(), nullValue());
View Full Code Here

Examples of org.glassfish.grizzly.Buffer.remaining()

            }
           
            final Buffer message = record.getMessage();
            final int pos = message.position();
           
            final int messageRemaining = message.remaining();

            final BufferArray bufferArray =
                    (totalRemaining >= messageRemaining) ?
                    message.toBufferArray() :
                    message.toBufferArray(pos, pos + totalRemaining);
View Full Code Here

Examples of org.glassfish.grizzly.FileTransfer.remaining()

        final FileTransfer f = new FileTransfer(file, offset, length);

        // lock further sendfile requests out
        fileTransferRequested = true;

        outputHeader.setContentLengthLong(f.remaining());
        if (outputHeader.getContentType() == null) {
            outputHeader.setContentType(MimeType.getByFilename(file.getName()));
        }
        // set Content-Encoding to identity to prevent compression
        outputHeader.setHeader(Header.ContentEncoding, HeaderValue.IDENTITY);
View Full Code Here

Examples of org.glassfish.grizzly.asyncqueue.AsyncWriteQueueRecord.remaining()

       
        final AsyncWriteQueueRecord currentRecord = writeTaskQueue.poll();

        if (currentRecord == null ||
                !canBeAggregated(currentRecord) ||
                queueSize == currentRecord.remaining()) {
            return currentRecord;
        }
       
        AsyncWriteQueueRecord nextRecord = checkAndGetNextRecord(writeTaskQueue);
       
View Full Code Here

Examples of org.glassfish.grizzly.memory.CompositeBuffer.remaining()

            if (originalMessage.isComposite()) {
                final CompositeBuffer compositeBuffer = (CompositeBuffer) originalMessage;
                compositeBuffer.shrink();

                if (!temporaryWriteBuffer.isDisposed()) {
                    if (compositeBuffer.remaining() == temporaryWriteBuffer.remaining()) {
                        compositeBuffer.allowInternalBuffersDispose(false);
                        compositeBuffer.tryDispose();
                        return temporaryWriteBuffer.cloneContent(memoryManager);
                    } else {
                        compositeBuffer.replace(temporaryWriteBuffer,
View Full Code Here

Examples of org.gudy.azureus2.core3.util.DirectByteBuffer.remaining()

    if ( !disk_manager.checkBlockConsistencyForWrite( "plugin", piece_number, offset, buffer )){
     
      throw( new DiskManagerException( "write invalid - parameters incorrect" ));
    }
   
    final int  length = buffer.remaining( DirectByteBuffer.SS_EXTERNAL );
   
    final DMWR request = new DMWR( disk_manager.createWriteRequest( piece_number, offset, buffer, null ),length );
   
    disk_manager.enqueueWriteRequest(
      request.getDelegate(),
View Full Code Here

Examples of org.gudy.azureus2.core3.util.DirectByteBuffer.remaining()

          if ((byte)offset != v ){
           
            System.out.println( "FMFileTest: write is bad at " + offset +
                      ": expected = " + (byte)offset + ", actual = " + v );
 
            offset += buffer.remaining( DirectByteBuffer.SS_FILE ) + 1;
           
            break;
          }
         
          offset++;
View Full Code Here

Examples of org.gudy.azureus2.core3.util.DirectByteBuffer.remaining()

     
      DirectByteBuffer buffer = buffers[i];
     
      limits[i] = buffer.limit( SS_FILE );
     
      int  rem = buffer.remaining( SS_FILE );

      if ( rem > rem_space ){
       
        buffer.limit( SS_FILE, buffer.position( SS_FILE ) + rem_space );
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.