Examples of rewind()


Examples of java.nio.ByteBuffer.rewind()

        throw new IOException("Meta magic is bad in block " + block);
      }
      // Toss the header. May have to remove later due to performance.
      buf.compact();
      buf.limit(buf.limit() - METABLOCKMAGIC.length);
      buf.rewind();
      return buf;
    }

    /**
     * Read in a file block.
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

          throw new IOException("Data magic is bad in block " + block);
        }
        // Toss the header. May have to remove later due to performance.
        buf.compact();
        buf.limit(buf.limit() - DATABLOCKMAGIC.length);
        buf.rewind();

        readTime += System.currentTimeMillis() - now;
        readOps++;

        // Cache the block
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

        if (this.block == null || this.currKeyLen == 0) {
          throw new RuntimeException("you need to seekTo() before calling getKey()");
        }
        ByteBuffer keyBuff = this.block.slice();
        keyBuff.limit(this.currKeyLen);
        keyBuff.rewind();
        // Do keyBuff.asReadOnly()?
        return keyBuff;
      }

      public ByteBuffer getValue() {
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

        // TODO: Could this be done with one ByteBuffer rather than create two?
        ByteBuffer valueBuff = this.block.slice();
        valueBuff.position(this.currKeyLen);
        valueBuff = valueBuff.slice();
        valueBuff.limit(currValueLen);
        valueBuff.rewind();
        return valueBuff;
      }

      public boolean next() throws IOException {
        // LOG.deug("rem:" + block.remaining() + " p:" + block.position() +
View Full Code Here

Examples of java.nio.ByteBuffer.rewind()

      for (int j = 0; j < DEFAULT_RESPONSE_CHUNK_SIZE / patternSize; ++j)
      {
        bb.put(BODY_PATTERN.getBytes(Charset.defaultCharset()));
      }

          bb.rewind();
      request.getResponseContent().write(bb);
    }

    if (respSize % DEFAULT_RESPONSE_CHUNK_SIZE > 0)
    {
View Full Code Here

Examples of java.nio.CharBuffer.rewind()

        InputStream in = conn.getInputStream();
        CharBuffer cbuf = CharBuffer.allocate(length);
        Reader reader = new InputStreamReader(in);
        reader.read(cbuf);
        in.close();
        cbuf.rewind();

        return cbuf;
    }

    @SuppressWarnings("unchecked")
View Full Code Here

Examples of java.nio.DoubleBuffer.rewind()

        // on performance. So, it is actually better to copy the array each time the picking is
        // done than to hog memory with a permanent copy.
        // It is also still better to copy the buffer only when picking rather than at each rendering
        double[] array = new double[getVertexCount()*3];
        DoubleBuffer db = (DoubleBuffer)super.getCoordRefBuffer().getBuffer();
        db.rewind();
        db.get(array); // optimized get
        return array;
      }
    };
      ta.setCoordRefBuffer(new J3DBuffer(nioCoords));
View Full Code Here

Examples of java.nio.FloatBuffer.rewind()

            // we need to check to make sure that the vbo is available each time through the loop because loading
            // textures may force vbos out of the cache (see loop below).
            if (!this.shouldUseVBOs(dc))
            {
                FloatBuffer vb = this.coordBuffer;
                gl.glVertexPointer(ColladaAbstractGeometry.COORDS_PER_VERTEX, GL.GL_FLOAT, 0, vb.rewind());
            }

            for (Geometry geometry : this.geometries)
            {
                Material nextMaterial = geometry.material != null ? geometry.material : defaultMaterial;
View Full Code Here

Examples of java.nio.IntBuffer.rewind()

    System.out.println(
      "DEVICE_SPECIFIER: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEVICE_SPECIFIER));
    System.out.println("EXTENSIONS: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_EXTENSIONS));

    //mo query
    buffer.rewind();
    buffer.position(0);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));

    System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
View Full Code Here

Examples of java.nio.IntBuffer.rewind()

        contextAttribList.put(44100);
        contextAttribList.put(ALC10.ALC_REFRESH);
        contextAttribList.put(60);
        contextAttribList.put(ALC10.ALC_SYNC);
        contextAttribList.put(ALC10.ALC_FALSE);
        contextAttribList.rewind();
        // ALC_MAX_AUXILIARY_SENDS won't go above compile-time max. Set to compile-time max if
        // greater.
        contextAttribList.put(EFX10.ALC_MAX_AUXILIARY_SENDS);
        contextAttribList.put(2);
        final ALCcontext newContext = ALC10.alcCreateContext(device, contextAttribList);
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.