Examples of limit()


Examples of java.nio.ByteBuffer.limit()

          }
        }

        ByteBuffer last_buff = (ByteBuffer)raw_buffers[buffer_count - 1 ];
       
        int orig_last_limit = last_buff.limit();
       
        if ( total_sofar > max_bytes ){
         
          last_buff.limit( orig_last_limit - (total_sofar - max_bytes) );
        }
View Full Code Here

Examples of java.nio.ByteBuffer.limit()

       
        int orig_last_limit = last_buff.limit();
       
        if ( total_sofar > max_bytes ){
         
          last_buff.limit( orig_last_limit - (total_sofar - max_bytes) );
        }

        transport.write( raw_buffers, 0, buffer_count );

        last_buff.limit( orig_last_limit );
View Full Code Here

Examples of java.nio.ByteBuffer.limit()

          last_buff.limit( orig_last_limit - (total_sofar - max_bytes) );
        }

        transport.write( raw_buffers, 0, buffer_count );

        last_buff.limit( orig_last_limit );

        int pos = 0;
        boolean stop = false;

        while( !queue.isEmpty() && !stop ) {
View Full Code Here

Examples of java.nio.ByteBuffer.limit()

          DirectByteBuffer[] payloads = msg.getRawData();

          for( int x=0; x < payloads.length; x++ ) {
            ByteBuffer bb = payloads[x].getBuffer( DirectByteBuffer.SS_NET );

            int bytes_written = (bb.limit() - bb.remaining()) - orig_positions[ pos ];
            total_size -= bytes_written;

            if ( msg.getType() == Message.TYPE_DATA_PAYLOAD ){
              total_data_size -= bytes_written;
            }
View Full Code Here

Examples of java.nio.ByteBuffer.limit()

              int written = 0;

              for( int i=0; i < payloads.length; i++ ) {
                ByteBuffer buff = payloads[i].getBuffer( DirectByteBuffer.SS_NET );

                message_size += buff.limit();

                if( i < x ) {  //if in front of non-empty buffer
                  written += buff.limit();
                }
                else if( i == x ) {  //is non-empty buffer
View Full Code Here

Examples of java.nio.CharBuffer.limit()

            CoderResult result = decoder.decode(inbuf, dest, true);
            dest.flip();

            if (result.isUnderflow()) { // done reading
                // make sure there is at least one extra character
                if (dest.limit() == dest.capacity()) {
                    dest = CharBuffer.allocate(dest.capacity()+1).put(dest);
                    dest.flip();
                }
                return dest;
            } else if (result.isOverflow()) { // buffer too small; expand
View Full Code Here

Examples of java.nio.DoubleBuffer.limit()

    return direct_buffer;
  }

  private static DoubleBuffer doNoCopyWrap(DoubleBuffer buffer) {
    DoubleBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static ByteBuffer lookupBuffer(ByteBuffer buffer) {
View Full Code Here

Examples of java.nio.FloatBuffer.limit()

    return direct_buffer;
  }

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
    FloatBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
View Full Code Here

Examples of java.nio.IntBuffer.limit()

    return direct_buffer;
  }

  private static IntBuffer doNoCopyWrap(IntBuffer buffer) {
    IntBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
View Full Code Here

Examples of java.nio.LongBuffer.limit()

    return direct_buffer;
  }

  private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
    LongBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static DoubleBuffer doNoCopyWrap(DoubleBuffer buffer) {
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.