{"id":398,"date":"2023-03-23T07:06:35","date_gmt":"2023-03-23T07:06:35","guid":{"rendered":"https:\/\/yunshangtulv.com.cn\/?p=398"},"modified":"2023-03-23T07:06:35","modified_gmt":"2023-03-23T07:06:35","slug":"%e4%ba%8c%e8%bf%9b%e5%88%b6%e6%96%87%e4%bb%b6%e8%af%a6%e8%a7%a3%e5%8f%8a%e5%ba%94%e7%94%a8%e5%ae%9e%e4%be%8b","status":"publish","type":"post","link":"https:\/\/yunshangtulv.com.cn\/?p=398","title":{"rendered":"\u4e8c\u8fdb\u5236\u6587\u4ef6\u8be6\u89e3\u53ca\u5e94\u7528\u5b9e\u4f8b"},"content":{"rendered":"<div class=\"group w-full text-gray-800 dark:text-gray-100 border-b border-black\/10 dark:border-gray-900\/50 bg-gray-50 dark:bg-[#444654]\">\n<div class=\"text-base gap-4 md:gap-6 md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0 m-auto\">\n<div class=\"relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]\">\n<div class=\"flex flex-grow flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose w-full break-words dark:prose-invert dark\">\n<p>\u5728R\u4e2d\uff0c\u4e8c\u8fdb\u5236\u6587\u4ef6\u6307\u7684\u662f\u4ee5\u4e8c\u8fdb\u5236\u683c\u5f0f\u5b58\u50a8\u6570\u636e\u7684\u6587\u4ef6\u3002\u4e8c\u8fdb\u5236\u6587\u4ef6\u53ef\u4ee5\u6709\u6548\u5730\u51cf\u5c0f\u6587\u4ef6\u4f53\u79ef\u5e76\u63d0\u9ad8\u6570\u636e\u8bfb\u5199\u901f\u5ea6\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u89e3\u91caR\u8bed\u8a00\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u64cd\u4f5c\uff0c\u4ee5\u53ca\u63d0\u4f9b\u4e00\u4e9b\u5e94\u7528\u5b9e\u4f8b\u3002<\/p>\n<ol>\n<li>\u4e8c\u8fdb\u5236\u6587\u4ef6\u64cd\u4f5c<\/li>\n<\/ol>\n<p>R\u8bed\u8a00\u4e2d\u53ef\u4ee5\u901a\u8fc7<code>writeBin<\/code>\u548c<code>readBin<\/code>\u51fd\u6570\u6765\u5199\u5165\u548c\u8bfb\u53d6\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<p><code>writeBin<\/code>\u51fd\u6570\u7684\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\">writeBin<span class=\"hljs-punctuation\">(<\/span>object<span class=\"hljs-punctuation\">,<\/span> con<span class=\"hljs-punctuation\">,<\/span> size <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-literal\">NA_integer_<\/span><span class=\"hljs-punctuation\">,<\/span> endian <span class=\"hljs-operator\">=<\/span> .Platform<span class=\"hljs-operator\">$<\/span>endian<span class=\"hljs-punctuation\">,<\/span> useBytes <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-literal\">FALSE<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p><code>readBin<\/code>\u51fd\u6570\u7684\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\">readBin<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">,<\/span> what<span class=\"hljs-punctuation\">,<\/span> n <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">1<\/span><span class=\"hljs-punctuation\">,<\/span> size <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-literal\">NA_integer_<\/span><span class=\"hljs-punctuation\">,<\/span> signed <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-literal\">TRUE<\/span><span class=\"hljs-punctuation\">,<\/span> endian <span class=\"hljs-operator\">=<\/span> .Platform<span class=\"hljs-operator\">$<\/span>endian<span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>object\uff1a\u8981\u5199\u5165\u7684\u5bf9\u8c61\uff08\u901a\u5e38\u662f\u5411\u91cf\uff09<\/li>\n<li>con\uff1a\u4e00\u4e2a\u8fde\u63a5\u5bf9\u8c61\uff0c\u7528\u4e8e\u6307\u5b9a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u8def\u5f84<\/li>\n<li>size\uff1a\u6bcf\u4e2a\u5143\u7d20\u6240\u5360\u5b57\u8282\u5927\u5c0f<\/li>\n<li>endian\uff1a\u5b57\u8282\u5e8f\uff08\"big\"\u6216\"little\"\uff09\uff0c\u9ed8\u8ba4\u4e3a\u5f53\u524d\u5e73\u53f0\u7684\u5b57\u8282\u5e8f<\/li>\n<li>useBytes\uff1a\u662f\u5426\u4ee5\u5b57\u8282\u8868\u793a\u6570\u636e<\/li>\n<li>what\uff1a\u8981\u8bfb\u53d6\u7684\u6570\u636e\u7c7b\u578b\uff08\u5982integer\u3001numeric\u3001character\u3001complex\u7b49\uff09<\/li>\n<li>n\uff1a\u8981\u8bfb\u53d6\u7684\u6570\u636e\u4e2a\u6570<\/li>\n<li>signed\uff1a\u662f\u5426\u4e3a\u6709\u7b26\u53f7\u6574\u6570\uff0c\u9ed8\u8ba4\u4e3aTRUE<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\u5e94\u7528\u5b9e\u4f8b<\/li>\n<\/ol>\n<h3>\u5b9e\u4f8b1\uff1a\u5199\u5165\u548c\u8bfb\u53d6\u6574\u6570<\/h3>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\"><span class=\"hljs-comment\"># \u521b\u5efa\u4e00\u4e2a\u6574\u6570\u5411\u91cf<\/span><br \/>\nint_vec <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">1<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">2<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">3<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">4<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">5<\/span><span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u5c06\u6574\u6570\u5411\u91cf\u5199\u5165\u4e8c\u8fdb\u5236\u6587\u4ef6<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"int_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"wb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nwriteBin<span class=\"hljs-punctuation\">(<\/span>int_vec<span class=\"hljs-punctuation\">,<\/span> con<span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u4ece\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u8bfb\u53d6\u6574\u6570\u5411\u91cf<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"int_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"rb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nresult <span class=\"hljs-operator\">&lt;-<\/span> readBin<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"integer\"<\/span><span class=\"hljs-punctuation\">,<\/span> n <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">5<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p>print<span class=\"hljs-punctuation\">(<\/span>result<span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<h3>\u5b9e\u4f8b2\uff1a\u5199\u5165\u548c\u8bfb\u53d6\u6d6e\u70b9\u6570<\/h3>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\"><span class=\"hljs-comment\"># \u521b\u5efa\u4e00\u4e2a\u6d6e\u70b9\u6570\u5411\u91cf<\/span><br \/>\nnum_vec <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">1.1<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">2.2<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">3.3<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">4.4<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">5.5<\/span><span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u5c06\u6d6e\u70b9\u6570\u5411\u91cf\u5199\u5165\u4e8c\u8fdb\u5236\u6587\u4ef6<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"num_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"wb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nwriteBin<span class=\"hljs-punctuation\">(<\/span>num_vec<span class=\"hljs-punctuation\">,<\/span> con<span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u4ece\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u8bfb\u53d6\u6d6e\u70b9\u6570\u5411\u91cf<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"num_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"rb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nresult <span class=\"hljs-operator\">&lt;-<\/span> readBin<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"numeric\"<\/span><span class=\"hljs-punctuation\">,<\/span> n <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">5<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p>print<span class=\"hljs-punctuation\">(<\/span>result<span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<h3>\u5b9e\u4f8b3\uff1a\u5199\u5165\u548c\u8bfb\u53d6\u5b57\u7b26\u4e32<\/h3>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\"><span class=\"hljs-comment\"># \u521b\u5efa\u4e00\u4e2a\u5b57\u7b26\u4e32\u5411\u91cf<\/span><br \/>\nstr_vec <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"hello\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"world\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"R\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"language\"<\/span><span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u5c06\u5b57\u7b26\u4e32\u5411\u91cf\u5199\u5165\u4e8c\u8fdb\u5236\u6587\u4ef6<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"str_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"wb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nwriteBin<span class=\"hljs-punctuation\">(<\/span>str_vec<span class=\"hljs-punctuation\">,<\/span> con<span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u4ece\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u8bfb\u53d6\u5b57\u7b26\u4e32\u5411\u91cf<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"str_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"rb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nresult <span class=\"hljs-operator\">&lt;-<\/span> readBin<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"character\"<\/span><span class=\"hljs-punctuation\">,<\/span> n <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">4<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p>print<span class=\"hljs-punctuation\">(<\/span>result<span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u793a\u4f8b\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u5982\u4e86\u5982\u4f55\u5728R\u8bed\u8a00\u4e2d\u4f7f\u7528\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u4e8c\u8fdb\u5236\u6587\u4ef6\u5728\u6570\u636e\u5b58\u50a8\u548c\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u5177\u6709\u4e00\u5b9a\u7684\u4f18\u52bf\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u5927\u578b\u6570\u636e\u96c6\u3002\u4ee5\u4e0b\u662f\u5bf9\u4e0a\u8ff0\u793a\u4f8b\u7684\u8865\u5145\uff1a<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"group w-full text-gray-800 dark:text-gray-100 border-b border-black\/10 dark:border-gray-900\/50 bg-gray-50 dark:bg-[#444654]\">\n<div class=\"text-base gap-4 md:gap-6 md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0 m-auto\">\n<div class=\"relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]\">\n<div class=\"flex flex-grow flex-col gap-3\">\n<div class=\"min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap\">\n<div class=\"markdown prose w-full break-words dark:prose-invert dark\">\n<h3>\u5b9e\u4f8b4\uff1a\u5199\u5165\u548c\u8bfb\u53d6\u590d\u6570<\/h3>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\"><span class=\"hljs-comment\"># \u521b\u5efa\u4e00\u4e2a\u590d\u6570\u5411\u91cf<\/span><br \/>\ncomplex_vec <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">1<\/span> <span class=\"hljs-operator\">+<\/span> <span class=\"hljs-number\">2i<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">3<\/span> <span class=\"hljs-operator\">-<\/span> <span class=\"hljs-number\">4i<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-operator\">-<\/span><span class=\"hljs-number\">1<\/span> <span class=\"hljs-operator\">-<\/span> <span class=\"hljs-number\">1i<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">5<\/span> <span class=\"hljs-operator\">+<\/span> <span class=\"hljs-number\">0i<\/span><span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u5c06\u590d\u6570\u5411\u91cf\u5199\u5165\u4e8c\u8fdb\u5236\u6587\u4ef6<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"complex_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"wb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nwriteBin<span class=\"hljs-punctuation\">(<\/span>complex_vec<span class=\"hljs-punctuation\">,<\/span> con<span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u4ece\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u8bfb\u53d6\u590d\u6570\u5411\u91cf<\/span><br \/>\ncon <span class=\"hljs-operator\">&lt;-<\/span> file<span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-string\">\"complex_data.bin\"<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"rb\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nresult <span class=\"hljs-operator\">&lt;-<\/span> readBin<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-string\">\"complex\"<\/span><span class=\"hljs-punctuation\">,<\/span> n <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">4<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\nclose<span class=\"hljs-punctuation\">(<\/span>con<span class=\"hljs-punctuation\">)<\/span><\/p>\n<p>print<span class=\"hljs-punctuation\">(<\/span>result<span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p>\u5728\u5904\u7406\u4e8c\u8fdb\u5236\u6587\u4ef6\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<ol>\n<li>\u5728\u8bfb\u5199\u6570\u636e\u65f6\uff0c\u52a1\u5fc5\u4f7f\u7528\u6b63\u786e\u7684\u6570\u636e\u7c7b\u578b\u3002\u5982\u679c\u6570\u636e\u7c7b\u578b\u4e0d\u5339\u914d\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u9519\u8bef\u7684\u7ed3\u679c\u6216\u635f\u574f\u6570\u636e\u3002<\/li>\n<li>\u5728\u4f7f\u7528<code>writeBin<\/code>\u548c<code>readBin<\/code>\u51fd\u6570\u65f6\uff0c\u9700\u8981\u4e3a\u8fde\u63a5\u5bf9\u8c61\uff08<code>con<\/code>\uff09\u6307\u5b9a\u6b63\u786e\u7684\u6a21\u5f0f\u3002\u5bf9\u4e8e\u5199\u5165\u64cd\u4f5c\uff0c\u4f7f\u7528<code>\"wb\"<\/code>\uff08\u5199\u5165\u4e8c\u8fdb\u5236\uff09\u6a21\u5f0f\uff0c\u5bf9\u4e8e\u8bfb\u53d6\u64cd\u4f5c\uff0c\u4f7f\u7528<code>\"rb\"<\/code>\uff08\u8bfb\u53d6\u4e8c\u8fdb\u5236\uff09\u6a21\u5f0f\u3002<\/li>\n<li>\u5f53\u8de8\u5e73\u53f0\u5904\u7406\u4e8c\u8fdb\u5236\u6587\u4ef6\u65f6\uff0c\u8981\u6ce8\u610f\u5b57\u8282\u5e8f\uff08endian\uff09\u7684\u95ee\u9898\u3002\u4e0d\u540c\u5e73\u53f0\u53ef\u80fd\u5177\u6709\u4e0d\u540c\u7684\u5b57\u8282\u5e8f\uff0c\u56e0\u6b64\u5728\u8de8\u5e73\u53f0\u8bfb\u5199\u6570\u636e\u65f6\uff0c\u9700\u8981\u660e\u786e\u6307\u5b9a\u5b57\u8282\u5e8f\u3002\u5728R\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>.Platform$endian<\/code>\u83b7\u53d6\u5f53\u524d\u5e73\u53f0\u7684\u5b57\u8282\u5e8f\u3002<\/li>\n<li>\u5f53\u5904\u7406\u5305\u542b\u591a\u79cd\u6570\u636e\u7c7b\u578b\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>seek<\/code>\u51fd\u6570\u8c03\u6574\u8fde\u63a5\u5bf9\u8c61\u7684\u8bfb\u5199\u4f4d\u7f6e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4e00\u4e2a\u6587\u4ef6\u5305\u542b\u4e00\u4e2a\u6574\u6570\u3001\u4e00\u4e2a\u6d6e\u70b9\u6570\u548c\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u4f7f\u7528<code>seek<\/code>\u51fd\u6570\u9010\u4e2a\u8bfb\u53d6\u6216\u5199\u5165\u8fd9\u4e9b\u6570\u636e\u3002<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728R\u4e2d\uff0c\u4e8c\u8fdb\u5236\u6587\u4ef6\u6307\u7684\u662f\u4ee5\u4e8c\u8fdb\u5236\u683c\u5f0f\u5b58\u50a8\u6570\u636e\u7684\u6587\u4ef6\u3002\u4e8c\u8fdb\u5236\u6587\u4ef6\u53ef\u4ee5\u6709\u6548\u5730\u51cf\u5c0f\u6587\u4ef6\u4f53\u79ef\u5e76\u63d0\u9ad8\u6570\u636e\u8bfb\u5199\u901f\u5ea6\u3002\u5728\u672c\u6587 [&hellip;]<\/p>\n","protected":false},"author":111,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-398","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/users\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":0,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"wp:attachment":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}