I'm completely stumped.. Seems like there'd be a simple solution
private Byte[] arrayOfBytes = null;
public Data(String input) {
arrayOfBytes = new Byte[input.getBytes().length];
arrayOfBytes = input.getBytes();
}
Throws the follwing error:
incompatible types
required: java.lang.Byte[]
found: byte[]
getBytes() from String returns a byte[] and you are trying to affect it to a Byte[].
byte is a primitive whereas Byte is a wrapper class (kind of like Integer and int).
What you can do is change :
private Byte[] arrayOfBytes = null;
to :
private byte[] arrayOfBytes = null;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With