EscPosEncoder { public static byte[] qrCodeCorrection(CorrectionLevel cl) { return encode(QRCODE_PREFIX, new byte[] { 0x31, 0x45 }, new byte[] { cl.getLevel() }); }  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 itShouldEncodeCorrectionLevel() throws Exception { assertArrayEquals(new byte[] { (byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x45, (byte)0x33 }, EscPosEncoder.qrCodeCorrection(CorrectionLevel.H)); }