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

📄 bindresp.java

📁 短信服务的源码,可以连接联通SMG等短信网关进行短信发送
💻 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:   BindResp.java

package spApi;

import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.channels.SocketChannel;
import java.nio.Buffer;
import java.nio.ByteBuffer;

// Referenced classes of package spApi:
//            SGIP_Command, MsgHead

public class BindResp extends SGIP_Command
{

    private static final int CommandLength = 9;
    private static final int CommandID = 0x80000001;
    private int Result;
    private int flag;

    public BindResp(long l)
    {
        super(l, 9, 0x80000001);
        flag = 1;
    }

    public BindResp(SGIP_Command sgip_command)
    {
        super(sgip_command);
        flag = 1;
    }

    public BindResp(MsgHead msghead)
    {
        super(msghead, 9, 0x80000001);
        flag = 1;
    }

    public BindResp()
    {
        super(9, 0x80000001);
        flag = 1;
    }

    public int GetFlag()
    {
        return flag;
    }

    public BindResp(long l, int i)
    {
        super(l, 9, 0x80000001);
        flag = 1;
        Result = i;
        bodybytes[0] = SGIP_Command.IntToByte(i);
    }

    public int readbody()
    {
        Result = bodybytes[0];
        flag = 0;
        return 0;
    }

    public int GetResult()
    {
        return Result;
    }

    public void SetResult(int i)
    {
        Result = i;
        bodybytes[0] = SGIP_Command.IntToByte(i);
    }

    public int write(OutputStream outputstream)
    {
        try
        {
            byte abyte0[] = new byte[TotalLength];
            SGIP_Command.BytesCopy(head.Head, abyte0, 0, 19, 0);
            SGIP_Command.BytesCopy(bodybytes, abyte0, 0, TotalLength - 20 - 1, 20);
            outputstream.write(abyte0);
            flag = 1;
            return 0;
        }
        catch(Exception exception)
        {
            System.out.println(exception.toString());
        }
        return -1;
    }

    public int write(SocketChannel channel)
    {
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate(TotalLength);

            byte abyte0[] = new byte[TotalLength];
            SGIP_Command.BytesCopy(head.Head, abyte0, 0, 19, 0);
            SGIP_Command.BytesCopy(bodybytes, abyte0, 0, TotalLength - 20 - 1, 20);

            buffer.put(abyte0 );
            channel.write(buffer);
            flag = 1;
            return 0;
        }
        catch(Exception exception)
        {
            System.out.println(exception.toString());
        }
        return -1;
    }

}

⌨️ 快捷键说明

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