All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.fontengine.font.mac.versResourceHandler Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
package com.adobe.fontengine.font.mac;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;

import com.adobe.internal.mac.resource.BasicResourceHandler;
import com.adobe.internal.mac.resource.ResourceParser.ResourceEntry;

public class versResourceHandler extends BasicResourceHandler 
{
	private static final byte[] vers = {'v', 'e', 'r', 's'};
	public versResourceHandler() 
	{
		super(vers);
	}

	public void handleResource(ResourceEntry entry,	long length, InputStream stream) 
	{
//		System.out.println("@@@ Resource Handler Plugin for type " + new String(handlerType));
//		System.out.println("\ttype = " + new String(type));
//		System.out.println("\tattributes = " + attributes);
//		System.out.println("\tname = " + name);
//		System.out.println("\tlength = " + length);

//		try {
//		dumpInputStreamAsBytes(stream, System.out);
//		} catch (IOException e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//		}
	}	

	public static void dumpInputStreamAsBytes(InputStream stream, PrintStream ps) 
	throws IOException
	{
		int b;
		int pos = 0;
		while ((b = stream.read()) != -1)
		{
			if (pos != 0)
			{
				ps.print(", ");
			}
			ps.print(Integer.toHexString(b));
			pos++;
			if (pos == 16)
			{
				ps.println();
				pos = 0;
			}
		}
		ps.println();
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy