Java tutorial
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.OutputStream; public class Main { public static final void writeLong(OutputStream o, long v) throws IOException { OutputStream out = o; out.write((int) (v >>> 56) & 0xFF); out.write((int) (v >>> 48) & 0xFF); out.write((int) (v >>> 40) & 0xFF); out.write((int) (v >>> 32) & 0xFF); out.write((int) (v >>> 24) & 0xFF); out.write((int) (v >>> 16) & 0xFF); out.write((int) (v >>> 8) & 0xFF); out.write((int) (v >>> 0) & 0xFF); } }