Examples of remaining()


Examples of java.nio.ByteBuffer.remaining()

     
      for (int i=array_offset;i<array_offset+length;i++){
       
        ByteBuffer  buffer = buffers[i];
       
        int  space = buffer.remaining();
       
        if ( space > 0 ){
         
          if ( space < read_insert.remaining()){
           
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

    final ByteBuffer bb = ByteBuffer.wrap( bytes );
   
    try{
      transport.write( bb, false );
     
      if ( bb.remaining() > 0 ){
       
        transport.registerForWriteSelects(
          new TransportHelper.selectListener()
          {
              public boolean
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

                Object       attachment )
              {
                try{
                  int written = helper.write( bb, false );
                 
                  if ( bb.remaining() > 0 ){
                 
                    helper.registerForWriteSelects( this, null );
                   
                  }else{
                   
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

     
      for (int i=array_offset;i<array_offset+length;i++){
       
        ByteBuffer  buffer = buffers[i];
       
        int  max = buffer.remaining();
       
        int  read = connection.read( buffer );
       
        total += read;
       
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

        ByteBuffer  b = (ByteBuffer)read_buffers.get(0);
               
        int  old_limit = b.limit();
       
        if ( b.remaining() > rem ){
         
          b.limit( b.position() + rem );
        }
       
        buffer.put( b );
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

     
      if( shrink_remaining_buffers ) {
        bb.limit( 0 )//ensure no read into this next buffer is possible
      }
      else {
        int remaining = bb.remaining();
       
        if( remaining < 1 continue//skip full buffer

        if( !marked ) {
          pre_read_start_buffer = i;
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

          marked = true;
        }

        if( remaining > allowed ) {  //read only part of this buffer
          bb.limit( bb.position() + allowed )//limit current buffer
          bytes_available += bb.remaining();
          shrink_remaining_buffers = true//shrink any tail buffers
        }
        else //full buffer is allowed to be read
          bytes_available += remaining;
          allowed -= remaining;  //count this buffer toward allowed and move on to the next
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

       
        copy.position( 0 );
       
        delayed_write = copy;
       
        return( copy.remaining());
      }
    }
   
    long  written = 0;
   
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

                   
                    BTBitfield bitfield = (BTBitfield)message;
           
                    ByteBuffer bb = bitfield.getBitfield().getBuffer((byte)0);
                   
                    byte[]  contents = new byte[bb.remaining()];
                   
                    bb.get( contents );
                                       
                  }else if ( message_id.equals( BTMessage.ID_BT_HAVE  )){
                   
View Full Code Here

Examples of java.nio.ByteBuffer.remaining()

     
      if( shrink_remaining_buffers ) {
        bb.limit( 0 )//ensure no read into this next buffer is possible
      }
      else {
        int remaining = bb.remaining();
       
        if( remaining < 1 continue//skip full buffer

        if( !marked ) {
          pre_read_start_buffer = i;
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.