Java OutputStream Write Endian writeInt16(OutputStream out, int i)

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

Description

write Int

License

Open Source License

Declaration

static void writeInt16(OutputStream out, int i) throws IOException 

Method Source Code

//package com.java2s;
/*//from  w  ww  .  j  a va  2  s .  co  m
 * Copyright (c) Nmote Ltd. 2004-2015. All rights reserved. 
 * See LICENSE doc in a root of project folder for additional information.
 */

import java.io.IOException;

import java.io.OutputStream;

public class Main {
    static void writeInt16(OutputStream out, int i) throws IOException {
        writeInt8(out, (i >> 8) & 0xFF);
        writeInt8(out, i & 0xFF);
    }

    static void writeInt8(OutputStream out, int i) throws IOException {
        out.write(i);
    }
}

Related

  1. writeInt24(OutputStream os, int value)
  2. writeInt24(OutputStream out, int value)
  3. writeInt2BE(OutputStream out, int v)
  4. writeInt2BE(OutputStream out, int v)