Code example for ByteBuffer

Methods: asIntBuffer, order

0
 
	/** A temporary working buffer */ 
    private static ByteBuffer scratchByteBuffer = ByteBuffer.allocateDirect(MAX_GLYPH_SIZE * MAX_GLYPH_SIZE * 4);
 
    static { 
		scratchByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
    } 
     
    /** A temporary working buffer */ 
    private static IntBuffer scratchIntBuffer = scratchByteBuffer.asIntBuffer();
     
     
	/** A temporary image used to generate the glyph page */ 
	private static BufferedImage scratchImage = new BufferedImage(MAX_GLYPH_SIZE, MAX_GLYPH_SIZE, BufferedImage.TYPE_INT_ARGB);
	/** The graphics context form the temporary image */ 
	private static Graphics2D scratchGraphics = (Graphics2D)scratchImage.getGraphics();
	 
	static { 
		scratchGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		scratchGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
		scratchGraphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);