编码问题?

扫码查看
本文介绍了编码问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个字节数组从C#传递给Java。


我在C#中使用了一个BinaryReader来读取字节数组。


我在Java中使用DataInputStream来读取字节数组。


数据正好通过,我得到了正确的

字节数,但数据看起来不正确。 :(


我认为这是一个编码问题。


如何在C#中创建一个与Java兼容的字节数组?


我应该使用什么编码?


谢谢,


Andrew


I''m trying to pass a byte array from C# to Java.

I used a BinaryReader in C# to read the byte array.

I''m using a DataInputStream in Java to read the byte array.

The data is passing through just fine, and I''m getting the correct
number of bytes, but the data doesn''t look right. :(

I assume this is an encoding issue.

How do I create a byte array in C# that is compatible with Java?

What encoding should I use?

Thanks,

Andrew


推荐答案









你在字节数组中加入什么?你怎么断定它是错误的?
错了?


- cd



What are you putting into the byte array? How are you concluding that it''s
wrong?

-cd





是的,我相信这就是我要找的东西。:)


Andrew



Yes, I believe that''s what I''m looking for. :)

Andrew


这篇关于编码问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 22:50
查看更多