简体   繁体   中英

How to cast vb6 byte array to Java Default Byte Array?

i'm making a program that will export a file with some data in byte array format.

But... i need to read this file trough a java program, and these two languages have different byte arrays format.

VB6 byte array have numbers like 0 to 255, but the java byte array can reach only the number 127.

Using the VB6, how can i cast this byte array to java standard?

You can use int instead of bytes. Java byte is signed but you can convert it with the following code:

public static int unsignedToBytes(byte by) { return by & 0xFF; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM