Code example for DataInput

Methods: skipBytes

0
     * points remain are compatible with the size of the float array to be read. 
     *  
     * @throws IOException 
     */ 
    public static int skipSamples(DataInput dataIn, int samplesToSkip) throws IOException {
        return dataIn.skipBytes(samplesToSkip * 4) / 4;
    } 
 
    private static void readDataArray(DataInput fis, float[] d, boolean byteOrder) throws IOException {
        byte[] dataBytes = new byte[d.length * 4];
        int numAdded = 0;
        int i = 0;
        fis.readFully(dataBytes);
        while (numAdded < d.length) {
            if (byteOrder == IntelByteOrder) {
                d[numAdded++] = Float.intBitsToFloat(((dataBytes[i++] & 0xff) << 0) + ((dataBytes[i++] & 0xff) << 8)
                        + ((dataBytes[i++] & 0xff) << 16) + ((dataBytes[i++] & 0xff) << 24));
            } else { 
                d[numAdded++] = Float.intBitsToFloat(((dataBytes[i++] & 0xff) << 24) + ((dataBytes[i++] & 0xff) << 16)
                        + ((dataBytes[i++] & 0xff) << 8) + ((dataBytes[i++] & 0xff) << 0));
            }