JLChen
2020-10-27 3c696793619750511f660d2b0ff8b303cb9fd081
hdl_core/src/main/java/com/hdl/sdk/hdl_core/Util/TransformUtil/StringUtil.java
@@ -84,7 +84,24 @@
                + (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1);
    }
    /**
     * 音乐命令变成byte数组
     * @param commandString
     * @return
     */
    public static byte [] GetMusicBytes (String commandString){
        byte [] bytes = new byte[0];
        try {
            bytes = commandString.getBytes("US-ASCII");
            byte [] sendBytes = new byte [bytes.length + 1];
            sendBytes [bytes.length] = 0x0D;
            System.arraycopy (bytes, 0, sendBytes, 0, bytes.length);
            return sendBytes;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return bytes;
        }
    }
//    private byte[] formatStyleHDLResponse(String responsePart1, String responsePart2, int maxLen) throws UnsupportedEncodingException {