⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deliver.java

📁 短信平台CMPP30 的JAVA程序,(含SQL数据库)
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   Deliver.java

package com.SGIP12.sgipdata;

import java.io.PrintStream;

// Referenced classes of package com.SGIP12.sgipdata:
//            SGIP_Command, MsgHead

public class Deliver extends SGIP_Command
{

    byte MessageByte[];
    int MessageCoding;
    String MessageContent;
    int MessageLength;
    private String Reserve;
    String SpNumber;
    int TP_pid;
    int TP_udhi;
    String UserNumber;

    public Deliver()
    {
    }

    public Deliver(SGIP_Command sgip_command)
    {
        super(sgip_command);
    }

    public Deliver(MsgHead msghead)
    {
        super(msghead);
    }

    public String byte2hex(byte b[])
    {
        String hs = "";
        String stmp = "";
        for(int n = 0; n < b.length; n++)
        {
            stmp = Integer.toHexString(b[n] & 0xff);
            if(stmp.length() == 1)
                hs = hs + "0" + stmp;
            else
                hs = hs + stmp;
            if(n < b.length - 1)
                hs = hs;
        }

        return hs.toUpperCase();
    }

    public byte[] getMessageByte()
    {
        return MessageByte;
    }

    public int getMessageCoding()
    {
        return MessageCoding;
    }

    public String getMessageContent()
    {
        return MessageContent;
    }

    public int getMessageLength()
    {
        return MessageLength;
    }

    public String getSPNumber()
    {
        return SpNumber;
    }

    public int getTP_pid()
    {
        return TP_pid;
    }

    public int getTP_udhi()
    {
        return TP_udhi;
    }

    public String getUserNumber()
    {
        return UserNumber;
    }

    public int readbody()
    {
        byte abyte0[] = new byte[4];
        UserNumber = new String(bodybytes, 0, 21);
        SpNumber = new String(bodybytes, 21, 21);
        TP_pid = bodybytes[42];
        TP_udhi = bodybytes[43];
        MessageCoding = bodybytes[44];
        SGIP_Command.BytesCopy(bodybytes, abyte0, 45, 48, 0);
        MessageLength = SGIP_Command.Bytes4ToInt(abyte0);
        if(MessageLength > 160)
        {
            System.out.println("Message Length is too long!  " + MessageLength);
            MessageLength = 160;
        }
        MessageByte = new byte[MessageLength];
        SGIP_Command.BytesCopy(bodybytes, MessageByte, 49, (49 + MessageLength) - 1, 0);
        MessageContent = new String(MessageByte);
        try
        {
            if(MessageCoding == 8)
                MessageContent = new String(MessageByte, "iso-10646-ucs-2");
            else
            if(MessageCoding == 4)
                MessageContent = "0x" + byte2hex(MessageByte);
            else
                MessageContent = new String(MessageByte, "gb2312");
        }
        catch(Exception e) { }
        return 0;
    }
}

⌨️ 快捷键说明

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