Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1004546 // Test structure/unstructure with byte array

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1647L/10K/36K).

!752

p {
  byte[] input = {5, 0x0a};
  S s = structure(input);
  print(s);
  O o = unstructure(s);
  S x = structure(o);
  assertEquals(s, x);
  assertTrue(o instanceof byte[]);
  assertEquals(2, ((byte[]) o).length);
  assertEquals((byte) 5, ((byte[]) o)[0]);
  assertEquals((byte) 0x0a, ((byte[]) o)[1]);
  print("OK");
}

Author comment

Began life as a copy of #1003318

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004546
Snippet name: Test structure/unstructure with byte array
Eternal ID of this version: #1004546/1
Text MD5: 6973dc80f59adc599e69d64fe0384f64
Transpilation MD5: 14dfec061c8621e03a35b1b78e19e5ca
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-20 17:06:53
Source code size: 338 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 552 / 595
Referenced in: [show references]