Examples of seek()


Examples of org.apache.pig.backend.datastorage.SeekableInputStream.seek()

            try {
                if (elem.systemElement())
                    throw new IOException ("Attempt is made to open system file " + elem.toString());
               
                SeekableInputStream sis = elem.sopen();
                sis.seek(offset, FLAGS.SEEK_SET);
                return sis;
            }
            catch (DataStorageException e) {
                throw new IOException("Failed to determine if elem=" + elem + " is container", e);
            }
View Full Code Here

Examples of org.apache.tajo.storage.CSVFile.CSVScanner.seek()

    fileScanner.init();
    for (int i = 0; i < TUPLE_NUM - 1; i++) {
      tuple.put(0, DatumFactory.createInt8(i));
      tuple.put(1, DatumFactory.createFloat8(i));
      long offsets = reader.find(tuple);
      fileScanner.seek(offsets);
      tuple = fileScanner.next();
      assertEquals(i,  (tuple.get(1).asInt8()));
      assertEquals(i, (tuple.get(2).asFloat8()) , 0.01);

      offsets = reader.next();
View Full Code Here

Examples of org.apache.xmlgraphics.image.codec.util.SeekableOutputStream.seek()

                // Save current position.
                long savePos = sos.getFilePointer();

                // Seek backward to the IFD offset and write IFD.
                sos.seek(ifdOffset);
                writeDirectory(ifdOffset, fields, nextIFDOffset);

                // Seek forward to position after data.
                sos.seek(savePos);
            } else if (tempFile != null) {
View Full Code Here

Examples of org.broad.igv.util.stream.IGVSeekableBufferedStream.seek()

                if(contentLength > 0) {
                    bufferSize = (int) Math.min(contentLength, bufferSize);
                }

                IGVSeekableBufferedStream bufferedStream = new IGVSeekableBufferedStream(ss, bufferSize);
                bufferedStream.seek(chrPos);

                reader = new LittleEndianInputStream(bufferedStream);
                int nBytes = reader.readInt();

                byte[] compressedBytes = new byte[nBytes];
View Full Code Here

Examples of org.broad.igv.util.stream.IGVSeekableFTPStream.seek()

        byte[] buffer = new byte[100];

        IGVSeekableFTPStream stream = new IGVSeekableFTPStream(new URL(url));

        for (int j = 0; j < 10; j++) {
            stream.seek(20 + j * 100);

            stream.read(buffer, 0, buffer.length);

            //for (int i = 0; i < 10; i++) {
            //System.out.println(buffer[i]);
View Full Code Here

Examples of org.broad.igv.util.stream.IGVSeekableHTTPStream.seek()

        String tdfFile = "http://www.broadinstitute.org/igvdata/annotations/hg18/conservation/omega.12mer.tdf";

        IGVSeekableHTTPStream hs = new IGVSeekableHTTPStream(new URL(tdfFile));
        final int position = 100;
        hs.seek(position);
        final int range = 1000;
        byte[] expectedBytes = new byte[range];
        hs.read(expectedBytes, 0, expectedBytes.length);

        SeekableServiceStream sss = new SeekableServiceStream(new URL(tdfFile));
View Full Code Here

Examples of org.broad.igv.util.stream.SeekableServiceStream.seek()

        final int range = 1000;
        byte[] expectedBytes = new byte[range];
        hs.read(expectedBytes, 0, expectedBytes.length);

        SeekableServiceStream sss = new SeekableServiceStream(new URL(tdfFile));
        sss.seek(position);
        byte[] bytes = new byte[range];
        sss.read(bytes, 0, bytes.length);

        for (int i = 0; i < expectedBytes.length; i++) {
            assertEquals(expectedBytes[i], bytes[i]);
View Full Code Here

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

            out.writeInt(0); // marker for the size...
            TranslogStreams.writeTranslogOperation(out, operation);
            out.flush();

            int size = out.size();
            out.seek(0);
            out.writeInt(size - 4);

            Location location = current.add(out.unsafeByteArray(), 0, size);
            if (syncOnEachOperation) {
                current.sync();
View Full Code Here

Examples of org.entityfs.RandomAccess.seek()

        {
          RandomAccess ra = new ReadWritableFileAdapter(f).openForRandomAccess(RandomAccessMode.READ_WRITE);
          try
          {
            long dataSize = b1.writeContentsTo(ra);
            ra.seek(0);
            int contentsVersion = b2.getContentsVersion();
            b2.replaceContentsWith(ra, dataSize);
            assertFalse(contentsVersion == b2.getContentsVersion());

            assertEquals(3, b2.getKeys().size());
View Full Code Here

Examples of org.fto.jthink.io.SmartAccessFile.seek()

          tmpReadBytes = 0;
        }
      }

      /* 查找请求数据的开始索引位置和请求数据块间的分隔串 */
      raf.seek(0);
      int v = raf.read();
      boundary = "";
      while(v!=13 && raf.getFilePointer() < totalBytes){
        boundary += (char)v;
        v = raf.read();
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.