write Int via OutputStream - Java java.io

Java examples for java.io:OutputStream

Description

write Int via OutputStream

Demo Code


//package com.java2s;

import java.io.IOException;

import java.io.OutputStream;

public class Main {
    public static void writeInt(int val, OutputStream out)
            throws IOException {
        out.write((val >>> 24) & 0xff);
        out.write((val >>> 16) & 0xff);
        out.write((val >>> 8) & 0xff);
        out.write(val & 0xff);
    }//  w w w. ja  va 2s.  co m
}

Related Tutorials