Java DataInputStream Read Long readLong(DataInputStream dataStream)

Here you can find the source of readLong(DataInputStream dataStream)

Description

read Long

License

Open Source License

Declaration

public static long readLong(DataInputStream dataStream) throws IOException 

Method Source Code

//package com.java2s;
/**//from   www  . j  ava2s  . c o m
 * Copyright (C) 2008-2009 Ralf Gerlich 
 * 
 * This file is part of OpenRadar.
 * 
 * OpenRadar is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * OpenRadar is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * OpenRadar. If not, see <http://www.gnu.org/licenses/>.
 * 
 * Diese Datei ist Teil von OpenRadar.
 * 
 * OpenRadar ist Freie Software: Sie k?nnen es unter den Bedingungen der GNU
 * General Public License, wie von der Free Software Foundation, Version 3 der
 * Lizenz oder (nach Ihrer Option) jeder sp?teren ver?ffentlichten Version,
 * weiterverbreiten und/oder modifizieren.
 * 
 * OpenRadar wird in der Hoffnung, dass es n?tzlich sein wird, aber OHNE JEDE
 * GEW?HELEISTUNG, bereitgestellt; sogar ohne die implizite Gew?hrleistung der
 * MARKTF?HIGKEIT oder EIGNUNG F?R EINEN BESTIMMTEN ZWECK. Siehe die GNU General
 * Public License f?r weitere Details.
 * 
 * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
 * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
 */

import java.io.DataInputStream;
import java.io.IOException;

public class Main {
    public static long readLong(DataInputStream dataStream) throws IOException {
        return ((long) dataStream.read() | (long) dataStream.read() << 8 | (long) dataStream.read() << 16
                | (long) dataStream.read() << 24 | (long) dataStream.read() << 32 | (long) dataStream.read() << 40
                | (long) dataStream.read() << 48 | (long) dataStream.read() << 56);
    }
}

Related

  1. readLong(DataInputStream inputStream)
  2. readLong(final DataInputStream in)
  3. readLong(final DataInputStream in)
  4. readLongString(DataInputStream in)