コード例 #1
0
ファイル: CompoundDataInput.java プロジェクト: JimSEOW/bdval
 /** {@inheritDoc} */
 public double readDouble() throws IOException {
   fileSize -= 8;
   if (fileSize < 0) {
     throw new EOFException();
   }
   return dataInput.readDouble();
 }
コード例 #2
0
 static void display() throws IOException {
   RandomAccessFile rf = new RandomAccessFile(file, "r");
   for (int i = 0; i < 7; i++) {
     System.out.println("Value " + i + " : " + rf.readDouble());
   }
   System.out.println(rf.readUTF());
   rf.close();
 }
コード例 #3
0
  public static void main(String[] args) throws Exception {
    RandomAccessFile randomAccessFile = new RandomAccessFile("ratest.dat", "rw");
    for (int i = 0; i < 5; i++) {
      randomAccessFile.writeDouble(i * 1.44);
    }
    randomAccessFile.close();
    ;

    randomAccessFile = new RandomAccessFile("ratest.dat", "rw");
    randomAccessFile.seek(2 * 8);

    randomAccessFile.writeDouble(48.123);
    randomAccessFile.close();

    randomAccessFile = new RandomAccessFile("ratest.dat", "rw");
    for (int i = 0; i < 5; i++) {
      System.out.println(randomAccessFile.readDouble());
    }
    randomAccessFile.close();
  }
コード例 #4
0
ファイル: PersistentTable.java プロジェクト: mbarry02/erddap
 /** This reads a binary double from the file. */
 public double readBinaryDouble(int col, int row) throws IOException {
   raf.seek(row * nBytesPerRow + columnStartAt[col]);
   return raf.readDouble();
 }
コード例 #5
0
 /* @see java.io.DataInput.readDouble() */
 public double readDouble() throws IOException {
   return raf.readDouble();
 }