Package java.io

Examples of java.io.RandomAccessFile.readShort()


                lastPath = dataFiles.next();
                input = new RandomAccessFile(lastPath.toFile(), "r");
                nextBlockPosition = 0;
            }
            // parse the next block
            int countIDs = input.readShort();
            chunks += countIDs;
            chunksPerBlock.update(countIDs);
            ArrayList<Integer> streamList = new ArrayList<>(50);
            for (int i = 0; i < countIDs; i++) {
                int streamID = input.readInt();
View Full Code Here


    public void test_readShort() throws IOException {
        // Test for method short java.io.RandomAccessFile.readShort()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

    public void test_writeShortI() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeShort(int)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeShort(Short.MIN_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Short.MIN_VALUE, raf
                .readShort());
        raf.close();
    }

    /**
 
View Full Code Here

    String player = (isP1 ? "p1" : "p2");
   
    // first, look up short name in name map
    String inName = ROOT_INPUT_DIR + subtreeDir + "game." + player + ".sol.bin";
    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidSolutionList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
View Full Code Here

    String inName = ROOT_INPUT_DIR + subtreeDir + "game." + player + ".sol.bin";
    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidSolutionList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
    listSize |= tmp & 0xFFFF;
   
    // binary search
View Full Code Here

    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidSolutionList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
    listSize |= tmp & 0xFFFF;
   
    // binary search
    int ixLow = 0;
View Full Code Here

    String player = (isP1 ? "p1" : "p2");
   
    // first, look up short name in name map
    String inName = ROOT_INPUT_DIR + subtreeDir + "nameMap." + player + ".bin";
    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidNameList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
View Full Code Here

    String inName = ROOT_INPUT_DIR + subtreeDir + "nameMap." + player + ".bin";
    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidNameList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
    listSize |= tmp & 0xFFFF;
    int maxLongNameLength = in.readShort();
   
View Full Code Here

    RandomAccessFile in = new RandomAccessFile(inName, "r");
    if(in.readShort() != Constants.vidNameList) {
      throw new RuntimeException();
    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
    listSize |= tmp & 0xFFFF;
    int maxLongNameLength = in.readShort();
   
    // binary search
View Full Code Here

    }
    short tmp = in.readShort();
    int listSize = in.readShort();
    listSize <<= 16;
    listSize |= tmp & 0xFFFF;
    int maxLongNameLength = in.readShort();
   
    // binary search
    int ixLow = 0;
    int ixHigh = listSize - 1;
    final int bytesPerRecord = maxLongNameLength + 4;
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.