-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathNxt$Transaction$ColoredCoinsAssetIssuanceAttachment.java
More file actions
67 lines (60 loc) · 1.92 KB
/
Nxt$Transaction$ColoredCoinsAssetIssuanceAttachment.java
File metadata and controls
67 lines (60 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.json.simple.JSONObject;
class Nxt$Transaction$ColoredCoinsAssetIssuanceAttachment
implements Nxt.Transaction.Attachment, Serializable
{
static final long serialVersionUID = 0L;
String name;
String description;
int quantity;
Nxt$Transaction$ColoredCoinsAssetIssuanceAttachment(String paramString1, String paramString2, int paramInt)
{
this.name = paramString1;
this.description = (paramString2 == null ? "" : paramString2);
this.quantity = paramInt;
}
public int getSize()
{
try
{
return 1 + this.name.getBytes("UTF-8").length + 2 + this.description.getBytes("UTF-8").length + 4;
}
catch (Exception localException) {}
return 0;
}
public byte[] getBytes()
{
try
{
byte[] arrayOfByte1 = this.name.getBytes("UTF-8");
byte[] arrayOfByte2 = this.description.getBytes("UTF-8");
ByteBuffer localByteBuffer = ByteBuffer.allocate(1 + arrayOfByte1.length + 2 + arrayOfByte2.length + 4);
localByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
localByteBuffer.put((byte)arrayOfByte1.length);
localByteBuffer.put(arrayOfByte1);
localByteBuffer.putShort((short)arrayOfByte2.length);
localByteBuffer.put(arrayOfByte2);
localByteBuffer.putInt(this.quantity);
return localByteBuffer.array();
}
catch (Exception localException) {}
return null;
}
public JSONObject getJSONObject()
{
JSONObject localJSONObject = new JSONObject();
localJSONObject.put("name", this.name);
localJSONObject.put("description", this.description);
localJSONObject.put("quantity", Integer.valueOf(this.quantity));
return localJSONObject;
}
public long getRecipientDeltaBalance()
{
return 0L;
}
public long getSenderDeltaBalance()
{
return 0L;
}