Java Encode encodeUInt32(int value, OutputStream out)

Here you can find the source of encodeUInt32(int value, OutputStream out)

Description

encode U Int

License

Open Source License

Declaration

private static void encodeUInt32(int value, OutputStream out) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.io.OutputStream;

public class Main {
    private static void encodeUInt32(int value, OutputStream out) throws IOException {
        byte[] tmp = new byte[4];
        tmp[0] = (byte) ((value >>> 24) & 0xff);
        tmp[1] = (byte) ((value >>> 16) & 0xff);
        tmp[2] = (byte) ((value >>> 8) & 0xff);
        tmp[3] = (byte) (value & 0xff);
        out.write(tmp);//from w w w. j a v  a 2  s .c om
    }
}

Related

  1. encodeRGBAsGrayScale(final byte[] raw, final int width, final int height, final int bitsPerPixel, final OutputStream out)
  2. encodeStringBase64(String str)
  3. encodeTagChar(char c, Appendable buffer)
  4. encodeToTargetEncoding(String text, String sourceEncoding, String targetEncoding)
  5. encodeUint(OutputStream out, final long value)
  6. encodeUnknownString(String in, OutputStream os)
  7. encodeUTCTime(long time, OutputStream os)
  8. encodeUtf8AsBase64(String data)
  9. encodeVarUInt32(int unsignedValue, OutputStream outputStream)