public static void main(String[] args){
        // 输出重定向
        BufferedOutputStream os = null;
        PrintStream ps = null;
        try {
            os = new BufferedOutputStream(new FileOutputStream("result_other.txt"), 1024);
            ps = new PrintStream(os, false);
            System.setOut(ps);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        PixelArray array = new PixelArray() {
            int width,height;
            int[] pix;
            @Override
            public void setSize(int width, int height) throws Exception {
                this.width = width;
                this.height = height;
                pix = new int[width*height];
            }

            @Override
            public void setPixel(int x, int y, int argb) {
                pix[x+y*width]=argb;
            }
        };

        try {
            FileInputStream is = new FileInputStream("/Users/JaySon/Desktop/test.jpg");
            OtherDecoder decoder = new OtherDecoder();
            decoder.decode(is,array);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }finally{
            if (ps != null){
                ps.close();
            }
        }


    }