gpt4 book ai didi

java - 我无法从 JSON 数组获取图像字节,有人可以帮助我吗?

转载 作者:行者123 更新时间:2023-12-01 12:53:45 25 4
gpt4 key购买 nike

这是我的 JSON 数组,我无法解析 ItemImage1Bytes来自这个 JSON 数组。谁能帮帮我。

   {"FetchAllItemsResult":[{"ItemID":5,
"ItemCategoryID":225,
"ItemCode":"1263",
"barcode":"0010000005",
"ItemDescription":"CAKE TRAY ROUND TEFAL 1 PCS (L) [RETAIL]",
"packingtypeid":1,
"ItemImage1":{"Bytes":[137,80,78,71,13,10,26,....]},
"sellingPrice":350.00,
"TaxPercentage":6.00},..]}

这是我的产品类别。

public class Product{
@SerializedName("ItemID")
int itemID;
@SerializedName("ItemCategoryID")
int itemCategoryID;
@SerializedName("ItemCode")
String itemCode;
@SerializedName("barcode")
String barCode;
@SerializedName("ItemDescription")
String itemDescription;
@SerializedName("packingtypeid")
int packingTypeID;
@SerializedName("sellingPrice")
double sellingPrice;
@SerializedName("TaxPercentage")
double taxPercentage;
@SerializedName("ItemImage1")
ProductImage itemImage;
}

这是 ProductImage 类。

   public class ProductImage {

@SerializedName("Bytes")
byte[] itemImage;
}

这是用于保存整个 JSON 数组的 ProductList 类。

  public class ProductList {
@SerializedName("FetchAllItemsResult")
List<Product> Products;
}

我正在使用Volley GsonRequest<ProductList>

没有错误,但我无法从 JSON 数组获取图像字节( ItemImage1Bytes ),请帮助我。

这是我得到的字节数组的输出。

[B@b2e761c8

最佳答案

关于java - 我无法从 JSON 数组获取图像字节,有人可以帮助我吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24032656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com