videoframe.java

来自「jcellbrowser kjava实现的手机浏览器」· Java 代码 · 共 52 行

JAVA
52
字号
package com.lightspeedleader.browser;

import java.io.DataInputStream;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Image;

public class VideoFrame {

    public int x;
    public int y;
    public HttpConnection conn;
    public DataInputStream dis;

    public VideoFrame() {
    }

    public void setXY(int i, int j) {
        x = i;
        y = j;
    }

    public void addStream(HttpConnection httpconnection, DataInputStream datainputstream) {
        conn = httpconnection;
        dis = datainputstream;
    }

    public Image getImage() {
        try {
            Image image;
            int i = dis.readUnsignedByte();
            int j = dis.readInt();
            byte abyte0[] = new byte[j];
            dis.readFully(abyte0);
            image = Image.createImage(abyte0, 0, j);
            return image;
        } catch (Exception exception) {
            return null;
        }
    }

    public void close() {
        try {
            dis.close();
            dis = null;
            conn.close();
            conn = null;
        }
        catch (Exception exception) {
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?