DbRecord.java
上传用户:haojie1228
上传日期:2022-08-08
资源大小:347k
文件大小:1k
- 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){
- //
- }
- }
- }