Java 资源加载库 Azzet

码农软件 · 软件分类 · 常用工具包 · 2019-08-15 05:58:23

软件介绍

Azzet 是一个简单的 Java 类库,用于从不同的源中加载资源。

示例代码:

BufferedImage img = Assets.load("http://www.google.com/logos/classicplus.png"); // loaded from website
Font fnt = Assets.load("myfont.ttf", new FontInfo(32.0f)); // loaded from classpath
Clip snd = Assets.load("C:\UserData\MyMusic.wav"); // loaded from file-system
BufferedImage gif = Assets.loadFrom("mygif.gif", BufferedImage.class); // you can request the return type
BufferedImage[] animatedGif = Assets.loadFrom("mygif.gif", "db"); // loads from DatabaseSource saved as "db"
Properties props = Assets.loadFrom("app.properties", "tcp"); // loads from TcpSource saved as "tcp"

支持的格式包括:

支持的数据源:

  • Classpath

  • File-System

  • Database

  • JAR

  • FTP

  • HTTP/HTTPS

  • UDP

  • TCP

  • SSL

  • UDP Multicast

示例代码:

FutureAssetBundle bundle = new FutureAssetBundle();
bundle.add( Assets.loadFuture("image.gif", BufferedImage.class) );
bundle.add( Assets.loadFuture("sound.wav", Clip.class) );

BufferedImage image = null;
Clip sound = null;

// game loop
while (running) {
   // do stuff
   // this occurs during the loading screen....
   if (bundle.isComplete()) {
       bundle.loaded(); // notify all FutureAsset implementations the asset has been accepted.
       image = bundle.getAsset("image.gif");
       sound = bundle.getAsset("sound.wav");
       // move from loading to play screen
   } else {
       display bundle.percentComplete();     
   }
   // do other stuff
}

本文地址:https://codercto.com/soft/d/12388.html

30天自制操作系统

30天自制操作系统

[日] 川合秀实 / 周自恒、李黎明、曾祥江、张文旭 / 人民邮电出版社 / 2012-8 / 99.00元

自己编写一个操作系统,是许多程序员的梦想。也许有人曾经挑战过,但因为太难而放弃了。其实你错了,你的失败并不是因为编写操作系统太难,而是因为没有人告诉你那其实是一件很简单的事。那么,你想不想再挑战一次呢? 这是一本兼具趣味性、实用性与学习性的书籍。作者从计算机的构造、汇编语言、C语言开始解说,让你在实践中掌握算法。在这本书的指导下,从零编写所有代码,30天后就可以制作出一个具有窗口系统的32位......一起来看看 《30天自制操作系统》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具