Java InputStream Read Long readLong(InputStream in)

Here you can find the source of readLong(InputStream in)

Description

read Long

License

Open Source License

Declaration

public static long readLong(InputStream in) throws IOException 

Method Source Code


//package com.java2s;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;

public class Main {
    public static long readLong(InputStream in) throws IOException {
        long b1 = in.read();
        long b2 = in.read();
        long b3 = in.read();
        long b4 = in.read();
        long b5 = in.read();
        long b6 = in.read();
        long b7 = in.read();
        long b8 = in.read();
        if (b8 == -1)
            throw new EOFException();
        return (long) ((b1 << 56) | (b2 << 48) | (b3 << 40) | (b4 << 32) | (b5 << 24) | (b6 << 16) | (b7 << 8)
                | (b8));/*from www .j  a v  a  2s  .  c om*/
    }
}

Related

  1. readLong(InputStream in)
  2. readLong(InputStream in)
  3. readLong(InputStream in)
  4. readLong(InputStream in)
  5. readLong(InputStream in)
  6. readLong(InputStream in)
  7. readLong(InputStream input)
  8. readLong(InputStream inputStream)
  9. readLong(InputStream inputStream)