Where to see the source code for Java library?

I need to know how the defaultWriteObject() of Hashtable is written. Anybody has any clue? Thanks a lot.
Soccer

If you have no tool, you can write your own tool:
import java.util.zip.*;
import java.io.*;
public class ZipTest {
     public static void main(String[] args) {
          if(args.length != 2) {
               System.err.println("using: java ZipTest [zip file] [target directory]");
               System.exit(1);
          String sourceFilename  = args[0];
          String targetDirectory = args[1];
          new ZipTest().unzip(sourceFilename, targetDirectory);
     public void unzip(String sourceFilename, String targetDirectory) {
          String fileSeparator = System.getProperty("file.separator");
          if(! targetDirectory.endsWith(fileSeparator)) {
               targetDirectory += fileSeparator;
          try {
               ZipFile zipFile = new ZipFile(sourceFilename);
               java.util.Enumeration entries = zipFile.entries();
               while(entries.hasMoreElements()) {
                    ZipEntry entry = (ZipEntry)entries.nextElement();
                    if(entry.isDirectory()) {
                         continue;
                    String name = entry.getName();
                    name = targetDirectory + name;
                    System.out.println(name);
                    File file = new File(name);
                    File directory = file.getParentFile();
                    if(! directory.exists()) {
                         directory.mkdirs();
                    BufferedInputStream bis = new BufferedInputStream(
                         zipFile.getInputStream(entry));
                    BufferedOutputStream bos = new BufferedOutputStream(
                         new FileOutputStream(file));
                    byte[] b = new byte[1024];
                    int count = 0;
                    while((count = bis.read(b, 0, 1024)) != -1) {
                         bos.write(b, 0, count);
                    bis.close();
                    bos.close();
               zipFile.close();
          } catch(java.io.IOException e) {
               System.err.println(e);
}

Similar Messages

  • Where to see the transaction code for a script

    Hai my dout is  where to see the transaction code for a script after assigning to  a drive programm for example i see output for medruck in me11 and for other standard scripts where can i see the  output is there any table avaible to check it

    Hi masthan,
       for sd and mm related scripts. u can use tnapr.
    Otherwise go to nace transaction u can find the script name as well as program name.
    Or u can try with TSTC table, which will give the t/c's.
    Regards...
    Arun.

  • How do I see the source code for 'NI Example Finder'?

    At the LabView Express demo, the rep showed us how to view the source code for 'NI Example Finder' (started with Help, Find Examples...). Please refresh my memory.
    --todd

    There are a couple of VI's that shipped with LabView 7.0, but you can't see the diagrams.
    C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\Run Example Finder__NATIONAL INSTRUMENTS.vi
    Press Ctrl-E on this VI and it prompts you for a password.
    This VI is run by C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\HelpServer__NAT​IONAL INSTRUMENTS.vi
    There's also C:\Program Files\National Instruments\LabVIEW 7.0\help\_exfinder.llb\Example Finder Launcher.vi.
    Tyring to open this VI starts the NI Example Finder. Note the taskbar icon which is different from the normal VI icon.
    It seems like NI is trying to keep us out, even if it used LabView to develop the Example Finder.

  • Need to find the source code for java.util.LinkedList

    Hello all,
    I'm new to the forums and I actually need the LinkedList source file as well as all the source files for all Java packages and libraries. Please post a link here if you can, or email me at [email protected]
    Thanks again!
    copter_man

    But those must be platform dependant, not really that
    interesting to look at. I have never felt any need to
    look at those at least.Wake up and smell the coffee, abbie! I read the source code all the time and constantly tell my students to do that, too.
    1. Java source code is not platform dependent. The original poster wanted to look at linked list code, how could that be platform dependent?
    2. It is the implementation of the SDK APIs, so by definition it is implementation dependent code, liable to change in a later version. So don't assume anything beyond what is claimed in the API documentation. However, sometimes the documentation is incomplete or ambiguous to you, and reading the source can provide some insight, however implementation dependent. (Light a candle or curse the darkness.)
    3. Why read source code? It's a good way to learn how to program. You see something in the API and ask: how'd they do that? Or you realize you want to do something broadly similar, but you can't reuse the source code.
    For example, Images are not Serializable, but suppose you want a small image that is part of an object to be serialized with the rest of the object without too much fuss (ie, without using javax.imageio). You notice ImageIcon is serializable, so you use it. (An ImageIcon has-an Image.) Then you wonder: how'd they do that? You read the source and then you know.
    You live, you learn,
    Nax

  • Where to find the source code for MenuTreeListPreviewLayoutController

    Dear All!
    I am desparately searching for the source code of the MenuTreeListPreviewLayoutController. I would like to
    implement a similar Layout Controller than the above mentioned one, but cannot find the code.
    Is anybody able to help me?
    Cheers and thanks in advance
    Ingo

    Hi Ingo,
    you should be able to find and decompile the class com.sapportals.wcm.rendering.layout.cm.MenuTreeListPreviewLayoutController in the JAR km.appl.ui.flex.control_core.jar. This JAR is located under ...<irj-root>\WEB-INF\portal\portalapps\com.sap.km.cm.ui.flex\private\lib
    Hope this helps,
    Robert
    PS: If you have problems to find it, gimme a mail and I'll send you the decompiled version.

  • How to see the source code in the API?

    Is it possible to see the source code for the String class in the Java API 1.4.2 somehow?

    one of the IDE's I have is GEL (gexperts.com), all you do is
    Search/Go To Class/
    select the class String, and the source code is displayed.
    pre-requisite is you have to specify the location of the api docs on your pc when
    installing GEL

  • Where's the source code for the JavaFX 8 Samples?

    Hi,
    I just downloaded the samples for JavaFX 8 and the menu popup on the top left really caught my attention.
    I'd like to study the source code for it. Does anyone know where I can find it?
    I expected it here http://hg.openjdk.java.net/openjfx/8/master/rt/file but it seems it's not there.
    Alternatively: Jasper Potts presented a Kiosk App at Devoxx 2012 (Antwerp), which was also used at JavaOne. I think this app uses the same Menu. And he said sources are available. But I can't remember the link.

    Oh, too obvious. They are directly included into the zip. My bad I didn't notice them. I had expected them to be online somewhere. Thanks!

  • Where can I get the source code for sun classes?

    Hello,
    When ever you download sun's j2sdk, the archive always contains the source code for the entire sdk in a zip file called src.zip except the sun.xxx classes like sun.awt.print.PrintDialog or sun.awt.font.FontResolver.
    For debugging purposes I need, if availabe, the source code of these classes which are not present in the src.zip.
    Please can someone tell me if theses classes are available as source and can point me where I can find it cause I am searching for it but can't find it on the net.
    Thank you
    Carolin

    Hey ChuckBing
    And your way is the only way, right? No.What on earth is eating you? Highly sensitive today?
    Where is the problem? There are two solutions of the question.
    The one link I posted points directly to the sun source download link. The "readme" explains, yippie, the sun sources are contained. Easy, isn't it?
    With the other one, you have to navigate at least through two other pages before you might find the link and only if you recognize that "Download JDK 5.0 source via SCSL/JRL" means the sun source code and not the sources contained in the JDK download. This is what I thought as I've seen this link the first time. Unfortunately there is no "readme".
    I prefer the easy way, I dont want to earn a doctorate. Ok, you can say dont "play the woman", but I'm a woman and a blonde too;-)
    But, let us stop the idle discussion here, please!
    Nevertheless, thanks to you and [email protected] for answering.

  • Where's the source code for the MIDP 2.0

    Hi
    does anybody know if the source code for the MIDP 2.0 is available anywhere, if so please give me the link, I've searched for it but couldn't find. I need it to create a custom class based on the Command class, but need to have a look at the source code of the "Command" to make the appropriate changes to my extending class, so I can't do it without a look under the hood.
    Any help would be greatly appreciated

    You can find reference implementations at http://java.sun.com/products/midp/index.jsp
    But they are only to assist manufacturers in implementing their own versions, and do not necessarily reflect the code running on a given device. All you can assume is what is stated in the MIDP specification. However, reading the RI code may help you better understand the spec.

  • I want to see the source code of JVM

    Can anyone tell me how to see the source code of JVM, but not the src.zip that including in the java libraries. I just want to know how Java is implemented.
    Thanks a lot for any answer.

    You can get the source code (written in C++) of Sun's VM under the Community Licence arangement. Not sure quite where it is on this site, but if you look for it, I'm sure you'll find it.
    BTW, it's not easy reading.
    Sylvia.

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Where to get the source code of the owa_cookie.send procedure?

    I want to know where you get the source code of the owa_cookie.send procedure? I can only get the header of this package from ...\RDBMS\ADMIN\pubcook.sql. Could you paste the whole source code here and then I can modify it to set the 'httponly' attribute? I also have a problem that after changing the package, how to use the package I changed? Does it still a system package here? Or it has been changed to an user-defined package in database and I need to execute the package on the database for the web server?
    Thank you!

    Hi Arun,
    I am unable to see the pcui_gp components in the DTR ,I require this in order to get the source code of one of its component.
    Can you please tell me the step by step procedure getting those pcui_gp components from J2ee engine to the  dtr or  NWDI.
    If there are any documents on pcui_gp components exclusively please do forward to my mail id [email protected]
    Thansk and Regards,
    Anand.

  • Is it possible to see the source code

    is it possible to see the source code when u know the transaction code for the same?

    hi Dhakshu,
    it possible,
    u run the t.code and there go to system-> status, there u can see the prog name for tht t.code, u double click on tht , u get the source code for thr t.code
    \[removed by moderator\]
    regards,
    chandu
    Edited by: Jan Stallkamp on Jun 25, 2008 1:17 PM

  • Is there any differnce between the Numeric Limit Test source code from TestStand 3.0 to TestStand 3.1? How to get the source code for the Numric Limit Test for both the versions?

    I need to know the differnece between the Numeric Limit Test between the TestStand version 3.0 to 3.1. If there is any differnec in the source code how to find it out? If somebody has the code can you share it?
    Thanks,
    Jeyan

    Hi,
    I don't believe there are any differences between the two versions. But you can check the source code for the Numeric Limit Test in TestStand\Components\NI\StepTypes\CommonSubsteps. But the main part of the step is the Code Module and this bit the users supplies this.
    What has prompted this question?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to view the source code for Native Method

    hi
    i am using some native methods in to my code ;
    can anybody tell me how to view the source code for the same ;
    nik

    Buy/acquire a C/C++/assembly code disassembler and run the shared library through it.

Maybe you are looking for