package com.naz.sdkdemo.helper;

import android.os.SystemClock;

import java.io.IOException;
import java.io.InputStream;

import tp.xmaihh.serialport.stick.AbsStickPackageHelper;

public class MyStickPackageHelper implements AbsStickPackageHelper {
    public MyStickPackageHelper() {
    }

    public byte[] execute(InputStream is) {
        try {
            int available = is.available();
            if (available > 0) {
                byte[] buffer = new byte[available];
                int size = is.read(buffer);
                if (size > 0) {
                    return buffer;
                }
            } else {
                SystemClock.sleep(500L);
            }
        } catch (IOException var5) {
            var5.printStackTrace();
        }

        return null;
    }
}
