public static void writeSingleByte(OutputStream out,int b) throws IOException {
  byte[] buffer=new byte[1];
  buffer[0]=(byte)(b & 0xff);
  out.write(buffer);
}

public static void writeSingleByte ( OutputStream out , int b ) throws IOException { byte [ ] buffer = new byte [ 1 ] ; buffer [ 0 ] = ( byte ) ( b & 0xff ) ; out . write ( buffer ) ; }
implements outputstream . write ( int ) in terms of outputstream . write ( byte [ ] , int , int ) . outputstream assumes that you implement outputstream . write ( int ) and provides default implementations of the others , but often the opposite is more efficient .
