Here you can find the source of writeInt(int v, OutputStream stream)
public static void writeInt(int v, OutputStream stream) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; public class Main { /**/* ww w. j av a 2s . co m*/ * Write the given int in little endian format as 4 bytes */ public static void writeInt(int v, OutputStream stream) throws IOException { writeByte((byte) (v & 0xFF), stream); writeByte((byte) ((v >> 8) & 0xFF), stream); writeByte((byte) ((v >> 16) & 0xFF), stream); writeByte((byte) ((v >> 24) & 0xFF), stream); } public static void writeByte(int v, OutputStream stream) throws IOException { stream.write(v); } public static void writeByte(byte v, OutputStream stream) throws IOException { stream.write(v); } }