Java OutputStream Write Int writeInt(OutputStream out, int i)

Here you can find the source of writeInt(OutputStream out, int i)

Description

write Int

License

Apache License

Declaration

public static final void writeInt(OutputStream out, int i) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.io.OutputStream;

public class Main {
    public static final void writeInt(OutputStream out, int i) throws IOException {
        byte[] b = new byte[4];
        b[0] = (byte) (i & 0xff);
        b[1] = (byte) (i >>> 8);
        b[2] = (byte) (i >>> 16);
        b[3] = (byte) (i >>> 24);
        out.write(b);/*from   w  w w . j  ava 2  s .com*/
    }

    public static final void write(OutputStream out, byte b) throws IOException {
        out.write(b & 0xff);
    }
}

Related

  1. writeInt(OutputStream os, int value)
  2. writeInt(OutputStream os, int value)
  3. writeInt(OutputStream os, long v)
  4. writeInt(OutputStream out, int i)
  5. writeInt(OutputStream out, int i)
  6. writeInt(OutputStream out, int i)
  7. writeInt(OutputStream out, int v)
  8. writeInt(OutputStream out, int v)
  9. writeInt(OutputStream out, int value)