*/
public final class MultiFormatWriter implements Writer {
- public ByteMatrix encode(byte[] contents, BarcodeFormat format, int width,
+ public ByteMatrix encode(String contents, BarcodeFormat format, int width,
int height) throws WriterException {
return encode(contents, format, width, height, null);
}
- public ByteMatrix encode(byte[] contents, BarcodeFormat format, int width, int height,
+ public ByteMatrix encode(String contents, BarcodeFormat format, int width, int height,
Hashtable hints) throws WriterException {
if (format == BarcodeFormat.QR_CODE) {
/**
* Encode a barcode using the default settings.
*
- * @param contents The raw contents to encode in the barcode
+ * @param contents The contents to encode in the barcode
* @param format The barcode format to generate
* @param width The preferred width in pixels
* @param height The preferred height in pixels
* @return The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white)
*/
- ByteMatrix encode(byte[] contents, BarcodeFormat format, int width, int height)
+ ByteMatrix encode(String contents, BarcodeFormat format, int width, int height)
throws WriterException;
/**
*
- * @param contents The raw contents to encode in the barcode
+ * @param contents The contents to encode in the barcode
* @param format The barcode format to generate
* @param width The preferred width in pixels
* @param height The preferred height in pixels
* @param hints Additional parameters to supply to the encoder
* @return The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white)
*/
- ByteMatrix encode(byte[] contents, BarcodeFormat format, int width, int height, Hashtable hints)
+ ByteMatrix encode(String contents, BarcodeFormat format, int width, int height, Hashtable hints)
throws WriterException;
}
private static final int QUIET_ZONE_SIZE = 4;
- public ByteMatrix encode(byte[] contents, BarcodeFormat format, int width, int height)
+ public ByteMatrix encode(String contents, BarcodeFormat format, int width, int height)
throws WriterException {
return encode(contents, format, width, height, null);
}
- public ByteMatrix encode(byte[] contents, BarcodeFormat format, int width, int height,
+ public ByteMatrix encode(String contents, BarcodeFormat format, int width, int height,
Hashtable hints) throws WriterException {
- if (contents == null || contents.length == 0) {
+ if (contents == null || contents.length() == 0) {
throw new IllegalArgumentException("Found empty contents");
}