I am currently working on converting .JPEG file to .WSQ file, I have successfully done it in Java using a library from http://sourceforge.net/projects/jmrtd/.
Now I wanted to do the same thing in C#, I converted the .jar files into .dll files using IKVM and I can call the libraries of Java in my C# application. But there is a problem, in Java, I found out that the function to convert JPEG to WSQ is available in the external library which is added as an external SPI from the META-INF/service folder. Something like http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html.
The external library is called "indirectly" in Java from what I understand, how can I do this in C#? Is this even possible?
If the "external library" a second jar file then compile both jar files in one step with the parenthesis syntax. Then it should work.
For details see the IKVM wiki:
Convert a jar file to a dll and use it as library
ClassLoader
I'm new to c# and programming in general. I've started to create my own powerpoint plugin. I've got it to where a user can browse for a zip file but now I need to know - How do I parse information from a file within that zip or compound file in c#?
Do I have to use a library? If so how do I go about that?
As others have mentioned, the System.IO.Compression namespace has the ZipFile class for creating/extracting zip files. However, they are only available in .NET 4.5 however, which is currently only available as part of the Visual Studio 2012 RC.
See System.IO.Compression in:
.NET 4
.NET 4.5
Up until this point, the de-facto standard for working with zip files in .NET has been the DotNetZip Library. It is available under the open-source MS-PL license.
Also see:
Handling Zip Files Without Third Party Lib in .NET 4.0?
To work with ZIP-files in general, use the ZipArchive class that represents a ZIP file, or the members of the static ZipFile class to work with ZIP files, and use the DeflateStream class to read the contents of a compressed file.
To easily read the contents of a binary file, use the BinaryReader class. Otherwise, use the StreamReader class for text files.
I am learning Java these days and I've spent a lot of time with .NET so when I want to export or import libraries, they are usually in .dll format which is called assemblies in .NET environment and they are compiled to IL and they can have resources like images, XML, audio and so on, anyways.
I am wondering the same process in Java as well. I've read documents but they actually confused me a little bit and to clarify things out I need your help guys.
Questions:
.NET Assembly is the same thing as Java .jar?
.dll contains compiled IL code and .jar contains compiled .class/byte code files?
They say resources, what kind of resources we are talking about here? Images, .txt files, etc. or all of them possible?
I've examined AWS (Amazon Web Service API for java) and I saw three .jar file and they are
aws-java-sdk-1.1.1.jar
aws-java-sdk-1.1.1-javadoc.jar
aws-java-sdk-1.1.1-sources.jar
and they contain .class files - java documentation in html format and .java files which are still not compiled. So then I've realized .jar doesn't just include compiled byte codes (.class) and also other things.
When I want to import java libraries, will I always need to import .jar files?
When I want to export my own java libraries, should I need to export in .jar file.
Thanks for help in advance.
Is a .NET Assembly the same thing as a Java .jar?
They play the same role, yes.
.dll contains compiled IL code and .jar contains compiled .class/byte code files?
Yes. Although JARs are just zip files (you can open them in your favorite Zip tool), so they can really contain just about anything.
They say resources, what kind of resources we are talking about here? Images, .txt files, etc. or all of them are possible?
Any file type is allowed in a JAR. Your Java code can access the contents of files within the jar via, for example, getResourceAsStream or getResource. Obviously .class files in a JAR are treated specially (as bytecode).
I've examined AWS (Amazon Web Service API for Java) and I saw three .jar files and they are: aws-java-sdk-1.1.1.jar, aws-java-sdk-1.1.1-javadoc.jar, aws-java-sdk-1.1.1-sources.jar
The above packaging is fairly common. Sometimes people use .jar as an alternative file extension to .zip. I find this practice confusing, but it is not uncommon, and Amazon has done it in this case. I think this practice became more common with the launch of Maven, which stores reference source code in files named .jar.
aws-java-sdk-1.1.1.jar - This is the only file necessary for compilation and execution. It contains the classes (.class files) and resources necessary for the library to function.
aws-java-sdk-1.1.1-sources.jar - This is just a zip file that contains the source code (.java files) for the library. It is not necessary for compilation or execution. It is provided to help you troubleshoot problems you may encounter while using the library. You could unzip this file and read the source code from your hard drive. However, your IDE can probably utilize this file directly by creating a "source attachment" to the main library JAR. With this library->source association set up in your IDE, your IDE will be able to show you the source code of the library when you use your IDE's "Go to Definition" feature on a library class.
aws-java-sdk-1.1.1-javadoc.jar - This is just a zip file that contains the JavaDoc for the library. Again, it is not necessary for compilation or execution. JavaDoc is just HTML, so you could unzip this file and read the JavaDoc HTML directly from your hard drive. However, most IDEs can create a "Javadoc attachment" to the main library, which allows you to pull up context-sensitive JavaDoc for the library from within the IDE. Actually, most IDEs can generate the JavaDoc on the fly from the -sources.jar, so I rarely use Javadoc jars anymore.
When I want to import Java libraries, will I always need to import .jar files?
It's usually called "adding JARs to the classpath", but yes. You pretty much always need to help Java find all the JARs you're using by constructing a classpath whenever you build or execute. In general, using JARs and classpaths is a much more manual and explicit process than using DLLs in .NET. For example Java has no direct equivalent of .NET's "global assembly cache"; also vanilla Java will not automatically load .jars from the working directory.
There are a few other techniques for creating a more "automatic" feeling classpath, but they are kind of advanced: Manifest.MF classpaths are possible, for example -- but this approach is used infrequently as it is brittle. As of Java 6, Java has limited support for using wildcards in the classpath.
When I want to export my own Java libraries, should I need to export in .jar file
This is standard, yes.
I can answer part of that question :-)
As I understand it, a jar is just a "Java Archive" file. It can contain anything you want, but is most often used to distribute binary versions of libraries. It can also be used for distributing executables -- double-clicking a JAR file will launch the application, if that's how it's been packaged.
As such, it may be difficult to tell what a particular jar file is intended for. For example, what is aws-java-sdk-1.1.1-sources.jar?. Is it a self-installer? A compressed code archive? Without reading documentation, it's anybody's guess.
Edit: case in point, I just downloaded the JAI jar file assuming it was a binary build of the library. But in fact, it contains the installer application.
To answer this specific question.
aws-java-sdk-1.1.1.jar
aws-java-sdk-1.1.1-javadoc.jar
aws-java-sdk-1.1.1-sources.jar
The 1) is the compiler java archive file (jar), which in .NET is called a DLL. The 2) is the javadoc. An HTML documentation of java classes (found in 1)) along with method description. The 3) is the source code (java files) of 1).
When I want to import java libraries, will I always need to
import .jar files?
When I want to export my own java libraries, should I need to
export in .jar file.
For 1) If you need to use a class that is found in a jar file, then you'll need to import that jar into your project.
For 2) You don't need to. You can bundle your dependency jars into your library or package each into their own jars and import them into your project.
.NET Assembly is same thing as java .jar? Answer: Yes.
.dll contains compiled IL code and .jar contains complied .class/byte code files?
Answer: .jar files is an archived file of java resources, classes, images/icons/etc. that is necessary for an application, just like in .DLL. Class files contains compile java source codes (Called java bytecode).
The title pretty much states it.
Is there a way for me to unzip .tbz files in C#? Either using a third party library or just using normal libs to unzip .tbz files?
A tbz file is a tar + bzip2 compression archive.
You can try this open source library.
#ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2
library written entirely in C# for the
.NET platform.
I've just created a "bundle creator" app and I'd like to be able to produce a zipped .bundle file rather than have to copy the whole bundle folder.
ICSharpCode.SharpZLib Zip library to scuessfully create a archive file however the iPhone doesnt appear to uncompress it.
ZipArchive on Google Code might help you. Here is sample code.
SharpZipLib works well.
Edit: OK, so it didn't work for you I see in your edit ... but it's worked well for me in other cases (by which I mean non-iPhone).