Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.OutputStream;

import java.io.IOException;

public class Main {
    public static final int Write4(byte buf[], int ind, int v) {
        buf[ind] = (byte) (v & 0xff);
        buf[ind + 1] = (byte) ((v >> 8) & 0xff);
        buf[ind + 2] = (byte) ((v >> 16) & 0xff);
        buf[ind + 3] = (byte) ((v >> 24) & 0xff);
        return ind + 2;
    }

    public static final void Write4(OutputStream out, int v) throws IOException {
        out.write(v & 0xff);
        out.write((v >> 8) & 0xff);
        out.write((v >> 16) & 0xff);
        out.write((v >> 24) & 0xff);
    }
}