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

📄 cmppconnect.java

📁 移动短信网关接口源程序框架
💻 JAVA
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-4-16 11:12:21
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   cmppConnect.java

package com.aspire.cmppApi;

import java.io.*;

// Referenced classes of package com.aspire.cmppApi:
//            MD5, cmppCommon, cmppSocket

public class cmppConnect
{

    public cmppConnect(cmppSocket cmppsocket)
    {
        SourceAddr = "";
        AuthenticatorSP = "";
        Version = 1;
        timestamp = "";
        conn = cmppsocket;
        SequenceId = 0;
        CommandID = 1;
        TotalLength = 39;
        bodybytes = new byte[27];
        headbytes = new byte[12];
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(TotalLength), headbytes, 0, 3, 0);
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(CommandID), headbytes, 0, 3, 4);
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(SequenceId), headbytes, 0, 3, 8);
    }

    public int getTotalLength()
    {
        return TotalLength;
    }

    public int sendcmppConnect()
    {
        int i = 0;
        synchronized(conn)
        {
            try
            {
                conn.bout.write(headbytes);
                conn.bout.write(bodybytes);
                conn.bout.flush();
            }
            catch(IOException ioexception)
            {
                System.out.println(ioexception.toString());
                i = -5;
                int j = i;
                return j;
            }
        }
        return i;
    }

    public void setSequenceId(int i)
    {
        SequenceId = i;
        cmppCommon.BytesCopy(cmppCommon.IntToBytes4(i), headbytes, 0, 3, 8);
    }

    public void setcmppConnects(String s, String s1, int i, String s2)
    {
        byte abyte0[];
        if(s.length() > 6)
            abyte0 = new byte[6];
        else
            abyte0 = new byte[s.length()];
        int j = 0;
        abyte0 = s.getBytes();
        cmppCommon.BytesCopy(abyte0, bodybytes, 0, abyte0.length - 1, j);
        j += 6;
        byte abyte1[] = new byte[9];
        byte abyte2[] = new byte[s1.length()];
        abyte2 = s1.getBytes();
        byte abyte3[] = s2.getBytes();
        byte abyte4[] = new byte[abyte0.length + 9 + abyte2.length + abyte3.length];
        int k = 0;
        cmppCommon.BytesCopy(abyte0, abyte4, 0, abyte0.length - 1, k);
        k += abyte0.length;
        cmppCommon.BytesCopy(abyte1, abyte4, 0, abyte1.length - 1, k);
        k += abyte1.length;
        cmppCommon.BytesCopy(abyte2, abyte4, 0, abyte2.length - 1, k);
        k += abyte2.length;
        cmppCommon.BytesCopy(abyte3, abyte4, 0, abyte3.length - 1, k);
        MD5 md5 = new MD5();
        md5.Init();
        md5.Update(abyte4);
        abyte4 = md5.Final();
        cmppCommon.BytesCopy(abyte4, bodybytes, 0, abyte4.length - 1, j);
        j += abyte4.length;
        bodybytes[j] = (byte)i;
        j++;
        int l = Integer.parseInt(s2);
        byte abyte5[] = new byte[4];
        abyte5 = cmppCommon.IntToBytes4(l);
        cmppCommon.BytesCopy(abyte5, bodybytes, 0, 3, j);
    }

    public byte bodybytes[];
    public byte headbytes[];
    String SourceAddr;
    String AuthenticatorSP;
    int Version;
    String timestamp;
    private int CommandID;
    private int SequenceId;
    int TotalLength;
    cmppSocket conn;
}

⌨️ 快捷键说明

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