package com.ningdatech.carapi.client;

import java.io.*;
import java.net.*;

public class RadarClient {
    private Socket socket;
    private DataInputStream input;
    private DataOutputStream output;

    public RadarClient(String host, int port) throws IOException {
        socket = new Socket(host, port);
        input = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
        output = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
    }

    public void sendData(byte[] data) throws IOException {
        output.write(data);
        output.flush();
    }

    public byte[] receiveData() throws IOException {
        // 实现接收数据的逻辑
        return null;
    }

    public void close() throws IOException {
        input.close();
        output.close();
        socket.close();
    }
}