Package java.io

Examples of java.io.DataInputStream.skipBytes()


    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readDouble();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readDouble();
    }
    in.close();
    return data;
  }
View Full Code Here


 
  public static float[] readFloat(String file, int first, int skipBytes, int length) throws IOException{
    float[] data = new float[length];
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readFloat();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readFloat();
    }
View Full Code Here

    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readFloat();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readFloat();
    }
    in.close();
    return data;
  }
View Full Code Here

   */
  public static int[] readInt(String file, int first, int skipBytes, int length) throws IOException{
    int[] data = new int[length];
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readInt();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readInt();
    }
View Full Code Here

    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readInt();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readInt();
    }
    in.close();
    return data;
  }
View Full Code Here

  public static boolean[] readBoolean(String file, int first, int skipBytes, int length) throws IOException{
    boolean[] data = new boolean[length];
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readBoolean();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readBoolean();
    }
View Full Code Here

    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readBoolean();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readBoolean();
    }
    in.close();
    return data;
  }
View Full Code Here

  }
 
  private static double[][] readDoubleByRow(String file, int first, int skipBytes,int rowNumber, int columnNumber) throws IOException{
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    double[][] data = new double[rowNumber][columnNumber];
    in.skipBytes(first);
    data[0][0] = in.readDouble();
    for(int colIndex=1; colIndex<columnNumber; ++colIndex){
      in.skipBytes(skipBytes);
      data[0][colIndex] = in.readDouble();
    }
View Full Code Here

    DataInputStream in = new DataInputStream(new FileInputStream(file));
    double[][] data = new double[rowNumber][columnNumber];
    in.skipBytes(first);
    data[0][0] = in.readDouble();
    for(int colIndex=1; colIndex<columnNumber; ++colIndex){
      in.skipBytes(skipBytes);
      data[0][colIndex] = in.readDouble();
    }
    for(int rowIndex=1; rowIndex<rowNumber; ++rowIndex){
      for(int colIndex=0; colIndex<columnNumber; ++colIndex){
        in.skipBytes(skipBytes);
View Full Code Here

      in.skipBytes(skipBytes);
      data[0][colIndex] = in.readDouble();
    }
    for(int rowIndex=1; rowIndex<rowNumber; ++rowIndex){
      for(int colIndex=0; colIndex<columnNumber; ++colIndex){
        in.skipBytes(skipBytes);
        data[rowIndex][colIndex] = in.readDouble();
      }
    }
    in.close();
    return data;
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.