Here you can find the source of writeInt16(OutputStream out, int i)
static void writeInt16(OutputStream out, int i) throws IOException
//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); } }