Mercurial Hosting > luan
comparison src/goodjava/rpc/RpcCon.java @ 1419:59fd2e8b1b9d
stringify and json_string
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 25 Oct 2019 22:12:06 -0600 |
parents | 27efb1fcbcb5 |
children | aaac1d29edea |
comparison
equal
deleted
inserted
replaced
1418:732b5de211fc | 1419:59fd2e8b1b9d |
---|---|
50 void write(InputStream in,long lenIn,List list) | 50 void write(InputStream in,long lenIn,List list) |
51 throws RpcError | 51 throws RpcError |
52 { | 52 { |
53 if( in != null ) | 53 if( in != null ) |
54 list.add(0,lenIn); | 54 list.add(0,lenIn); |
55 String json = JsonToString.toString(list); | 55 String json = new JsonToString().toString(list); |
56 byte[] aJson = json.getBytes(StandardCharsets.UTF_8); | 56 byte[] aJson = json.getBytes(StandardCharsets.UTF_8); |
57 int len = aJson.length; | 57 int len = aJson.length; |
58 byte[] a = new byte[4+len]; | 58 byte[] a = new byte[4+len]; |
59 a[0] = (byte)(len >>> 24); | 59 a[0] = (byte)(len >>> 24); |
60 a[1] = (byte)(len >>> 16); | 60 a[1] = (byte)(len >>> 16); |