Examples of readByte()


Examples of org.apache.cassandra.io.util.BufferedRandomAccessFile.readByte()

        BufferedRandomAccessFile origFile    = new BufferedRandomAccessFile(orig.descriptor.filenameFor(SSTable.COMPONENT_DATA), "r", 8 * 1024 * 1024);
        BufferedRandomAccessFile cleanedFile = new BufferedRandomAccessFile(cleaned.descriptor.filenameFor(SSTable.COMPONENT_DATA), "r", 8 * 1024 * 1024);

        while(origFile.getFilePointer() < origFile.length() && cleanedFile.getFilePointer() < cleanedFile.length())
        {
            assert origFile.readByte() == cleanedFile.readByte();
        }
        assert origFile.getFilePointer() == origFile.length();
        assert cleanedFile.getFilePointer() == cleanedFile.length();
    }
}
View Full Code Here

Examples of org.apache.commons.vfs.RandomAccessContent.readByte()

            ra.writeByte(TEST_DATA.charAt(10));
            ra.writeByte(TEST_DATA.charAt(11));

            // now read
            ra.seek(0);
            assertEquals(ra.readByte(), TEST_DATA.charAt(0));

            ra.seek(3);
            assertEquals(ra.readByte(), TEST_DATA.charAt(7));
            assertEquals(ra.readByte(), TEST_DATA.charAt(8));
View Full Code Here

Examples of org.apache.commons.vfs2.RandomAccessContent.readByte()

        {
            file = getReadFolder().resolveFile("file1.txt");
            RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READ);

            // read first byte
            byte c = ra.readByte();
            assertEquals(c, TEST_DATA.charAt(0));
            assertEquals("fp", ra.getFilePointer(), 1);

            // start at pos 4
            ra.seek(3);
View Full Code Here

Examples of org.apache.derby.iapi.services.io.ArrayInputStream.readByte()

    lrdi.setPosition(PAGE_HEADER_OFFSET);
    long spare;

    isOverflowPage  =  lrdi.readBoolean();
    setPageStatus    (lrdi.readByte());
    setPageVersion    (lrdi.readLong());
    slotsInUse      =  lrdi.readUnsignedShort();
    nextId          =  lrdi.readInt();
    generation      =  lrdi.readInt();     // page generation (Future Use)
    prevGeneration  =  lrdi.readInt();     // previous generation (Future Use)
View Full Code Here

Examples of org.apache.hadoop.dfs.DFSClient.DFSDataInputStream.readByte()

  }
 
  Block getFirstBlock(FileSystem fs, Path path) throws IOException {
    DFSDataInputStream in =
      (DFSDataInputStream) ((DistributedFileSystem)fs).open(path);
    in.readByte();
    return in.getCurrentBlock();
  }
 
  public void testDataTransferProtocol() throws IOException {
    Random random = new Random();
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataInputStream.readByte()

          case 0x1f8b: // RFC 1952
            i.seek(0);
            in = new GZIPInputStream(i);
            break;
          case 0x5345: // 'S' 'E'
            if (i.readByte() == 'Q') {
              i.close();
              in = new TextRecordInputStream(src, srcFs, configuration);
            }
            break;
          default:
View Full Code Here

Examples of org.apache.hadoop.hdfs.DFSClient.DFSDataInputStream.readByte()

  }
 
  public static Block getFirstBlock(FileSystem fs, Path path) throws IOException {
    DFSDataInputStream in =
      (DFSDataInputStream) ((DistributedFileSystem)fs).open(path);
    in.readByte();
    return in.getCurrentBlock();
 

  public static List<LocatedBlock> getAllBlocks(FSDataInputStream in)
      throws IOException {
View Full Code Here

Examples of org.apache.hadoop.hdfs.client.HdfsDataInputStream.readByte()

  }
 
  public static ExtendedBlock getFirstBlock(FileSystem fs, Path path) throws IOException {
    HdfsDataInputStream in = (HdfsDataInputStream) fs.open(path);
    try {
      in.readByte();
      return in.getCurrentBlock();
    } finally {
      in.close();
    }
  } 
View Full Code Here

Examples of org.apache.hadoop.io.DataInputBuffer.readByte()

        inBuffer.reset(payload, payload.length);

        try {
            String app = inBuffer.readUTF();
            int numMessages = inBuffer.readInt();
            byte compression = inBuffer.readByte();
            long crc = inBuffer.readLong();
            byte[] messages = new byte[inBuffer.readInt()];
            inBuffer.read(messages);

            return new TMessageSet(
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekInputStream.readByte()

        checkLineCol(in, line, col) ;
        assertEquals(0, in.getPosition()) ;
       
        for ( int i = 0 ; i < contents.length(); i++ )
        {
            int x = in.readByte() ;
            if ( x != -1 )
            {
                if ( x == '\n' )
                {
                    line++ ;
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.