Examples of position()


Examples of org.elasticsearch.common.io.stream.BytesStreamInput.position()

                    }
                    BytesStreamInput si = new BytesStreamInput(bos.unsafeByteArray(), 0, bos.size());
                    int position;
                    while (true) {
                        try {
                            position = si.position();
                            if (position + 4 > bos.size()) {
                                break;
                            }
                            int opSize = si.readInt();
                            int curPos = si.position();
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.position()

        if (!includeDefaults) {
            // simulate the generation to make sure we don't add unnecessary content if all is default
            // if all are defaults, no need to write it at all - generating is twice is ok though
            BytesStreamOutput bytesStreamOutput = new BytesStreamOutput(0);
            XContentBuilder b =  new XContentBuilder(builder.contentType().xContent(), bytesStreamOutput);
            long pos = bytesStreamOutput.position();
            innerToXContent(b, false);
            b.flush();
            if (pos == bytesStreamOutput.position()) {
                return builder;
            }
View Full Code Here

Examples of org.exist.storage.journal.JournalReader.position()

                    checkpointFound = false;
                }
          if (!checkpointFound) {
                    LOG.info("Unclean shutdown detected. Scanning journal...");
                    broker.getBrokerPool().reportStatus("Unclean shutdown detected. Scanning log...");
            reader.position(1);
            final Long2ObjectHashMap<Loggable> txnsStarted = new Long2ObjectHashMap<Loggable>();
            Checkpoint lastCheckpoint = null;
            long lastLsn = Lsn.LSN_INVALID;
                  Loggable next;
                  try {
View Full Code Here

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

     */
    protected int readPostBody(byte body[], int len)
            throws IOException {

        Buffer b = coyoteRequest.getPostBody(len).duplicate();
        final int length = b.limit() - b.position();
        b.get(body, b.position(), length);
        return length;

    }

View Full Code Here

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

       
        connection.close();
       
      }else{
       
        if ( read_buffer.position( DirectByteBuffer.SS_PROXY ) > 0 ){
         
          read_buffer.flip(DirectByteBuffer.SS_PROXY);
         
          int  written = read_buffer.write( DirectByteBuffer.SS_PROXY, chan2 );
                 
View Full Code Here

Examples of org.hornetq.core.journal.SequentialFile.position()

         sequentialFile.fill(0, fileSize, JournalImpl.FILL_CHARACTER);

         JournalImpl.initFileHeader(fileFactory, sequentialFile, userVersion, fileID);
      }

      long position = sequentialFile.position();

      sequentialFile.close();

      if (JournalFilesRepository.trace)
      {
View Full Code Here

Examples of org.infinispan.configuration.cache.InterceptorConfiguration.position()

            interceptor = interceptors.get(2);
            assertTrue(interceptor.interceptor() instanceof CustomInterceptor3);
            assertEquals(1, interceptor.index());
            interceptor = interceptors.get(3);
            assertTrue(interceptor.interceptor() instanceof CustomInterceptor4);
            assertEquals(InterceptorConfiguration.Position.LAST, interceptor.position());
            assertTrue(c.unsafe().unreliableReturnValues());

            c = cm.getCache("write-skew").getCacheConfiguration();
            assertTrue(c.locking().writeSkewCheck());
            assertEquals(IsolationLevel.REPEATABLE_READ, c.locking().isolationLevel());
View Full Code Here

Examples of org.infinispan.configuration.cache.InterceptorConfigurationBuilder.position()

               break;
            case INDEX:
               interceptorBuilder.index(Integer.parseInt(value));
               break;
            case POSITION:
               interceptorBuilder.position(Position.valueOf(value.toUpperCase()));
               break;
            default:
               throw ParseUtils.unexpectedAttribute(reader, i);
         }
      }
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataInputStream.position()

        byte[] buf={'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(buf);
        assert in.position() == 0;
        int skipped=in.skipBytes(6);
        assert skipped == 6;
        assert in.position() == 6;

        skipped=in.skipBytes(0);
        assert skipped == 0;
        assert in.position() == 6;
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataOutputStream.position()

            if(msg.getSrc() == null)
                msg.setSrc(local_addr);
            ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(128);
            msg.writeTo(out);
            for(int i=bind_port; i <= bind_port+port_range; i++) {
                DatagramPacket packet=new DatagramPacket(out.buffer(), 0, out.position(), dest_addr, i);
                sock.send(packet);
            }
        }
        catch(Exception ex) {
            log.error("failed sending discovery request", ex);
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.