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

📄 dbrecord.java

📁 联网斗地主 java版本 用jbuilder2005编写
💻 JAVA
字号:
package poker;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */
import java.io.*;

 class DbRecord {
  static String serverName;
  static String address;
  static String ServerID;
  static byte[] recordByte=new byte[60];

  public static void set(String serverName,String address,String ServerID){
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    DataOutputStream dos=new DataOutputStream(baos);
    OutputStream os;
    OutputStreamWriter osw=new OutputStreamWriter(dos);

    try{
      osw.flush();
      dos.writeUTF(serverName);
      dos.writeUTF(address);
      dos.writeUTF(ServerID);
      dos.flush();
      baos.flush();
      recordByte=baos.toByteArray();
      osw.close();
      dos.close();
      baos.close();
    }catch (IOException e){
    //
    }

  }

  public static void get(byte[] b){
    DataInputStream dis=new DataInputStream(new ByteArrayInputStream(b));
    InputStreamReader isr=new InputStreamReader(dis);
    try{
      //ServiceConnection  ss=new ServiceConnection(this,this.se);
      serverName=dis.readUTF();
      address=dis.readUTF();
      ServerID=dis.readUTF();
      isr.close();
      dis.close();
    }catch (IOException e){
      //
    }

  }


}

⌨️ 快捷键说明

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