jdk/src/share/classes/java/awt/Graphics.java
Print this page
*** 24,33 ****
--- 24,34 ----
*/
package java.awt;
import java.io.*;
import java.lang.*;
+ import java.nio.charset.StandardCharsets;
import java.util.*;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
/**
*** 842,852 ****
* is greater than the length of the <code>data</code> array.
* @see java.awt.Graphics#drawChars
* @see java.awt.Graphics#drawString
*/
public void drawBytes(byte data[], int offset, int length, int x, int y) {
! drawString(new String(data, 0, offset, length), x, y);
}
/**
* Draws as much of the specified image as is currently available.
* The image is drawn with its top-left corner at
--- 843,853 ----
* is greater than the length of the <code>data</code> array.
* @see java.awt.Graphics#drawChars
* @see java.awt.Graphics#drawString
*/
public void drawBytes(byte data[], int offset, int length, int x, int y) {
! drawString(new String(data, offset, length, StandardCharsets.ISO_8859_1), x, y);
}
/**
* Draws as much of the specified image as is currently available.
* The image is drawn with its top-left corner at