Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.imageio.ImageIO;

public class Main {

    public static void main(String[] args) throws IOException {
        byte[] picture = new byte[2048]; // your image data

        InputStream in = new ByteArrayInputStream(picture);

        BufferedImage buf = ImageIO.read(in);
        ColorModel model = buf.getColorModel();
        int height = buf.getHeight();
        int width = buf.getWidth();
    }

}