![](/img/trans.png)
[英]I am trying to access config.properties file but unable to access. Can anyone help me?
[英]I am unable to get image bytes from my JSON array, can anyone help me?
這是我的JSON數組,我無法解析此JSON數組中的ItemImage1
和Bytes
。 誰能幫我。
{"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;
}
這是ProductList類,用於容納整個JSON數組。
public class ProductList {
@SerializedName("FetchAllItemsResult")
List<Product> Products;
}
我正在使用Volley
GsonRequest<ProductList>
沒有錯誤,但我無法從JSON數組獲取Image Bytes( ItemImage1
和Bytes
),請幫助我。
這是我得到的字節數組的輸出。
[B@b2e761c8
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.