Lines Matching refs:data

34  * A segment of character/binary/control data in a QR Code symbol.
36 * <p>The mid-level way to create a segment is to take the payload data and call a
41 * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data.
51 * Returns a segment representing the specified binary data
55 * @param data the binary data (not {@code null})
56 * @return a segment (not {@code null}) containing the data
59 public static QrSegment makeBytes(byte[] data) {
60 Objects.requireNonNull(data);
61 if (data.length * 8L > Integer.MAX_VALUE)
63 int[] bits = new int[(data.length + 3) / 4];
64 for (int i = 0; i < data.length; i++)
65 bits[i >>> 2] |= (data[i] & 0xFF) << (~i << 3);
66 return new QrSegment(Mode.BYTE, data.length, bits, data.length * 8);
96 return new QrSegment(Mode.NUMERIC, digits.length(), bb.data, bb.bitLength);
128 return new QrSegment(Mode.ALPHANUMERIC, text.length(), bb.data, bb.bitLength);
159 * @return a segment (not {@code null}) containing the data
176 return new QrSegment(Mode.ECI, 0, bb.data, bb.bitLength);
223 /** The length of this segment's unencoded data. Measured in characters for
225 * Always zero or positive. Not the same as the data's bit length. */
228 // The data bits of this segment. Not null.
229 final int[] data;
231 // Requires 0 <= bitLength <= data.length * 32.
238 * Constructs a QR Code segment with the specified attributes and data.
242 * @param numCh the data length in characters or bytes, which is non-negative
243 * @param data the data bits (not {@code null})
244 * @param bitLen the number of valid prefix bits in the data array
245 * @throws NullPointerException if the mode or data is {@code null}
248 public QrSegment(Mode md, int numCh, int[] data, int bitLen) {
250 this.data = Objects.requireNonNull(data);
251 if (numCh < 0 || bitLen < 0 || bitLen > data.length * 32L)
297 * Describes how a segment's data bits are interpreted.