-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathNxt$Transaction$MessagingAliasAssignmentAttachment.java
More file actions
63 lines (56 loc) · 1.68 KB
/
Nxt$Transaction$MessagingAliasAssignmentAttachment.java
File metadata and controls
63 lines (56 loc) · 1.68 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
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.json.simple.JSONObject;
class Nxt$Transaction$MessagingAliasAssignmentAttachment
implements Nxt.Transaction.Attachment, Serializable
{
static final long serialVersionUID = 0L;
final String alias;
final String uri;
Nxt$Transaction$MessagingAliasAssignmentAttachment(String paramString1, String paramString2)
{
this.alias = paramString1;
this.uri = paramString2;
}
public int getSize()
{
try
{
return 1 + this.alias.getBytes("UTF-8").length + 2 + this.uri.getBytes("UTF-8").length;
}
catch (Exception localException) {}
return 0;
}
public byte[] getBytes()
{
try
{
byte[] arrayOfByte1 = this.alias.getBytes("UTF-8");
byte[] arrayOfByte2 = this.uri.getBytes("UTF-8");
ByteBuffer localByteBuffer = ByteBuffer.allocate(1 + arrayOfByte1.length + 2 + arrayOfByte2.length);
localByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
localByteBuffer.put((byte)arrayOfByte1.length);
localByteBuffer.put(arrayOfByte1);
localByteBuffer.putShort((short)arrayOfByte2.length);
localByteBuffer.put(arrayOfByte2);
return localByteBuffer.array();
}
catch (Exception localException) {}
return null;
}
public JSONObject getJSONObject()
{
JSONObject localJSONObject = new JSONObject();
localJSONObject.put("alias", this.alias);
localJSONObject.put("uri", this.uri);
return localJSONObject;
}
public long getRecipientDeltaBalance()
{
return 0L;
}
public long getSenderDeltaBalance()
{
return 0L;
}