Here you can find the source of writeInt(OutputStream os, long v)
public static void writeInt(OutputStream os, long v) throws IOException
//package com.java2s; import java.io.IOException; import java.io.OutputStream; public class Main { public static void writeInt(OutputStream os, long v) throws IOException { os.write((int) (v & 0xff)); os.write((int) ((v >>> 8) & 0xff)); os.write((int) ((v >>> 16) & 0xff)); os.write((int) ((v >>> 24) & 0xff)); }//from w ww . jav a2 s . co m }