---
title: "Java中String与byte[]的转换"
author: "lectery"
date: "2011-04-15T09:43:30Z"
tags: []
categories: ["编程语言"]
slug: "java-string-byte"
draft: false
lastmod: "2011-04-15T09:43:30Z"
id: 1003797
url: "https://lectery.iteye.com/blog/1003797"
---

- String -&gt; byte\[]: byte\[] bytes = s.getBytes();
- byte\[] -&gt; String: String str = new String(bytes);