Lines Matching refs:data

35  * The class provides static factory functions to create a QR Code from text or binary data.
40 * <li><p>High level: Take the payload data and call {@link QrCode#encodeText(String,Ecc)}
45 * <li><p>Low level: Custom-make the array of data codeword bytes (including segment headers and
78 * Returns a QR Code representing the specified binary data at the specified error correction level.
82 * @param data the binary data to encode (not {@code null})
84 * @return a QR Code (not {@code null}) representing the data
85 * @throws NullPointerException if the data or error correction level is {@code null}
86 * @throws DataTooLongException if the data fails to fit in the
89 public static QrCode encodeBinary(byte[] data, Ecc ecl) {
90 Objects.requireNonNull(data);
92 QrSegment seg = QrSegment.makeBytes(data);
152 int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available
156 if (version >= maxVersion) { // All versions in the range could not fit the given data
165 // Increase the error correction level while the data still fits in the current version number
171 // Concatenate all segments to create the data bit string
176 bb.appendBits(seg.data, seg.bitLength);
187 // Pad with alternating bytes until data capacity is reached
227 * error correction level, data codeword bytes, and mask number.
236 * or if the data is the wrong length for the specified version and error correction level
287 int data = errorCorrectionLevel.formatBits << 3 | msk; // errCorrLvl is uint2, mask is uint3
288 int rem = data;
291 int bits = (data << 10 | rem) ^ 0x5412; // uint15
326 // Returns a new byte string representing the given data with the appropriate error correction
328 private byte[] addEccAndInterleave(byte[] data) {
329 Objects.requireNonNull(data);
330 if (data.length != getNumDataCodewords(version, errorCorrectionLevel))
340 // Split data into blocks, calculate ECC, and interleave
347 rs.getRemainder(data, k, datLen, ecc);
348 for (int j = 0, l = i; j < datLen; j++, k++, l += numBlocks) { // Copy data
351 result[l] = data[k];
353 for (int j = 0, l = data.length + i; j < blockEccLen; j++, l += numBlocks) // Copy ECC
360 // Draws the given sequence of 8-bit codewords (data and error correction)
361 // onto the entire data area of this QR Code, based on the given bit indexes.
489 // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any