EscPosEncoder { public static byte[] qrCodeStore(String data) { try { return encode(QRCODE_PREFIX, new byte[] { 0x31, 0x50, 0x30 }, data.getBytes("utf8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }  static byte[] encodeLength(int length); static byte[] qrCodeModule(byte module); static byte[] qrCodeCorrection(CorrectionLevel cl); static byte[] qrCodeStore(String data); static byte[] qrCodePrint();  }
@Test public void itShouldEncodeStoreCode() throws Exception { assertArrayEquals(new byte[] { (byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x0d, (byte)0x00, (byte)0x31, (byte)0x50, (byte)0x30, (byte)0x56, (byte)0x69, (byte)0x76, (byte)0x61, (byte)0x20, (byte)0x43, (byte)0x68, (byte)0x69, (byte)0x6c, (byte)0x65 }, EscPosEncoder.qrCodeStore("Viva Chile")); }