我将字符串转换为byte [],然后再次使用getbytes()
和String构造的Java为String的byte [],字符串和字节[]问题的java
String message = "Hello World";
byte[] message1 = message.getbytes();
使用PipedInput/OutputStream中我发这个到另一个线程,其中,
byte[] getit = new byte[1000];
pipedinputstream.read(getit);
print(new String(getit));
这最后的打印结果1000打印...我想要的实际字符串长度。我怎样才能做到这一点?
'pipedinputstream'的类型是什么? – Shine
@Shine:做出一个有教养的猜测:-) –