BsoBird commented on issue #85:
URL: https://github.com/apache/fory/issues/85#issuecomment-4314452809
@chaokunyang
help!
```
public class Test0001 {
public static class ForyRowData {
public boolean fBool;
public byte fTiny;
public short fSmall;
public int fInt1;
public long fBigint;
public float fFloat;
public double fDouble;
public String fString;
public byte[] fBinary;
public int fDate;
public Long fTimestamp;
public long fDecimalRaw;
public int fDecimalScale;
public int fInt2;
}
public static void main() {
Fory fory = Fory.builder().withLanguage(Language.XLANG).build();
RowEncoder<ForyRowData> foryEncoder =
Encoders.bean(ForyRowData.class,fory);
ForyRowData frd = new ForyRowData();
frd.fBool = false;
frd.fTiny = 1;
frd.fSmall = 2;
frd.fInt1 = 3;
frd.fBigint = 4L;
frd.fFloat = 5.0f;
frd.fDouble = 6.0;
frd.fString = "asdasd";
frd.fBinary = new byte[]{1,2,3};
frd.fDate = 7;
frd.fTimestamp = 8L;
frd.fDecimalRaw = 9L;
frd.fDecimalScale = 10;
frd.fInt2 = 15;
BinaryRow bnyRow = foryEncoder.toRow(frd);
System.out.println("p 0 = " + bnyRow.getBoolean(0));
System.out.println("p 7 = " + bnyRow.getString(7));
System.out.println("p 13 = " + bnyRow.getInt32(13));
}
}
```
get result:
```
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:
arraycopy: last source index 1084227584 out of bounds for byte[240]
at java.base/java.lang.System.arraycopy(Native Method)
at org.apache.fory.memory.MemoryBuffer.get(MemoryBuffer.java:322)
at
org.apache.fory.format.row.binary.UnsafeTrait.getBinary(UnsafeTrait.java:138)
at
org.apache.fory.format.row.binary.BinaryRow.getBinary(BinaryRow.java:63)
at
org.apache.fory.format.row.binary.UnsafeTrait.getString(UnsafeTrait.java:121)
at
org.apache.fory.format.row.binary.BinaryRow.getString(BinaryRow.java:63)
```
if i not use getString,code working ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]