Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Java) ZATCA Decode QR CodeSee more ZATCA ExamplesDecodes a base64 ZATCA QR code. Note: This example requires Chilkat v9.5.0.92 or greater.
import com.chilkatsoft.*; public class ChilkatExample { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); System.exit(1); } } public static void main(String argv[]) { // Note: This example requires Chilkat v9.5.0.92 or greater. String qr = "ARdBaG1lZCBNb2hhbWVkIEFMIEFobWFkeQIPMzAwMDc1NTg4NzAwMDAzAxQyMDIyLTAzLTEzVDE0OjQwOjQwWgQHMTEwOC45MAUFMTQ0LjkGLCtiQTFtdWNWSTY3SDRXQ2JOL2U5SjJxVXBIVHQzVHdNZHhsa09XVGVvdjg9B2BNRVlDSVFDWWg1ZTNpcklxV2w1WXRhQ25LaXVqTUlUbW9rWFlPUE1wSURDSW9XVzc5d0loQU1YbWMrTUZIR3RhZUJzZU91RUdUbHdENmcwOWdOUVBSUHVZODlzNjVPV1MIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABNMAr2WtNWSj2uSrplhxz0cNFk/hv1LjMDgqbthcn6ydNWEuTNTQeyZJf1SfyMOFFM4cMpp+3wL+65Rj3fi+4w0JSDBGAiEAlcAzHKujzvjHJrAV1M/79RnYRqe66kmtgMUykr/N/CACIQDgTQwbfftw0pYo6FX8c63Q4edvFgt+7JhHaBlla0qRtQ=="; qr = "AQxGaXJveiBBc2hyYWYCCjEyMzQ1Njc4OTEDEzIwMjEtMTEtMTcgMDg6MzA6MDAEBjEwMC4wMAUFMTUuMDAGLDlmc3JYVW8rU3BYQVlJTkw5aGFLU2dEOXgxaVJsZk53SVBDZnBlWXczYTA9B1hYMEM4VjFIL3hUMGdOaytWWXh2U2Z6UFJlUjZPM2t5VXA0TERITzJLMzlNSGJETXVvTGltQSt3RnovV2pVdEdMSHpaK0J5enNmWUdEQzliNUFGSU1FQT09CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAARw3B+mu14x0h3pJFKqEWWT7DmD7jWYkZV7qHyikPlN4P/4/b7YD+A9wnFI92HTKm+/BGKXVf/pfLtsmdIIaPHnCUgwRgIhAMTjOkWwcNu5Aw5k1Yr3YgbPhdxKoJV1a3+5ShPtx1/IAiEAyrwsA/NuqV6XjybyrZpMp6eJAqslACLfCldti/PVOQs="; CkBinData bd = new CkBinData(); boolean success = bd.AppendEncoded(qr,"base64"); int index = 0; int expectedTag = 1; int tag; int len; String tagValue; while ((expectedTag <= 9)) { // Get the tag tag = bd.GetByte(index); if (tag != expectedTag) { System.out.println("Expected tag " + expectedTag); return; } index = index+1; len = bd.GetByte(index); if (len == 0) { System.out.println("Expected length > 0"); return; } index = index+1; // Tags 8 and 9 contain binary data. if (expectedTag >= 8) { tagValue = bd.getEncodedChunk(index,len,"base64"); } else { tagValue = bd.getTextChunk(index,len,"utf-8"); } System.out.println("tag " + tag + ": " + tagValue); index = index+len; expectedTag = expectedTag+1; } } } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.