编码问题? [英] Encoding Problem?

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

问题描述

我正在尝试将一个字节数组从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


推荐答案

你的意思是你应该使用什么样的编码来获得你的字节数组

你是谁?重新传递给JAVA?如果你已经有一个字节数组,

你只想从JAVA函数访问它,那么应该没有

" encoding"必要的。


Andrew写道:
Do you mean what kind of encoding should you use to get your byte array
that you''re going to pass to JAVA? If you already have a byte array,
and you just want to access it from a JAVA function there should be no
"encoding" necessary.

Andrew wrote:
我正在尝试将一个字节数组从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






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

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

我是'使用Java中的DataInputStream来读取字节数组。

数据传递得很好,我得到正确的字节数,但数据没有''好吧。 :(

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


为什么你会这么想?

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


字节数组是一个字节数组。

我应该使用什么编码?
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.
Why do you assume that?

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

What encoding should I use?




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


- cd



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

-cd


>你的意思是你应该使用什么样的编码来获得你要传递给你的字节数组
> Do you mean what kind of encoding should you use to get your byte array
JAVA?




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


Andrew



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

Andrew


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆