I need help from java sorceries.

Hello, I've discovered some magic in Java sources.
I looked into HttpURLConnection code, there is absolutely nothing about sockets. Look at this getStatusCode method:
getInputStream();
String resp = getHeaderField(0);
responseCode = parse(resp);Neither getInputStream() nor getHeaderField(int) are not defind in HttpUrlConnection class. Yes, these methods are defined in UrlConnection. Here is how it is done:
public String getHeaderField(int n) {return null;}
public InputStream getInputStream() throws IOException
{throw new UnknownServiceException("protocol doesn't support input");}Seems that UrlConnection do not support these metods. My only problem was to discover how can I read character header from binary socket stream and parse it without depricated readLine in DataInputStream.

HttpURLConnection is an abstract class, so it does not provide the implementation of what you're looking for. When you need an object of HttpURLConnection, you can't use new HttpURLConnection(), instead, you use URL.openConnection() or something like that. In that method, an object of the HttpURLConnection is created (actually an object of its sub-class as all abstract method must be implemented).
you should be able to get any header info via an object of HttpURLConnection, as all methods have already been implemented, though not in the HttpURLConnection class.
BTW, if you like readLine(), find it in BufferedReader class, it's the replacement of DataInputStream, but it's not recommanded for networking communication, as the new line control character(s) is platform dependant (some use '\n', while some use '\r\n').

Similar Messages

  • Would like to trace my ipod touch because I was robbed. I would find it please. need help from you guys. Not because I am able to get another. Thank you.

    would like to trace my ipod touch because I was robbed. I would find it please. need help from you guys. Not because I am able to get another. Thank you.

    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    iCloud: Find My iPhone
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it unless you had iOS 7 on the device. With iOS 7, one has to enter the Apple ID and password to restore the device.
    - Apple will do nothing without a court order                                                        
    Reporting a lost or stolen Apple product                                               
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • I need help from Customer Support. Whatever this charge is on my credit card,

     He recibido un cargo de su tienda, que curiosamente he visto que se han hecho muchos cargos a diferentes personas bajo el mismo copncepto y tienda.Favor acreditarme dicho monto porque no he comprado nada con ustedes y ni tengo idea donde está Minesota.Este es mi cargo. 23/07/15323343GEEKSQUAD RENE00015826 RICHFIELD UUSRD$1,428.010.00 Y veo en Internet que otros clientes han hecho reclamos del mismo concepto.   Subject Author PostedGEEKSQUAD RENE00015826Care‎03-09-2015 06:30 PMGEEKSQUAD RENE00015826 Unknown ChargePriscillaQ‎12-29-2014 10:08 PMrandom 10 dollar charge from richfield MN to my ac...ChrisBurns‎07-01-2015 12:50 PMUnknown Geeksquad charge on my Credit CardHardingR‎12-01-2014 05:57 PMGeekSquad protection terms changed without being i... Lo que me hace pensar que algo anda muy mal en ese Best Buy.  Como es posible que no hayan corregido e identificado quienes están detrás de este fraude que lleva años. I need help from Customer Support.  Whatever this charge is on my credit card,jesmann‎10-05-2014 04:52 PM  

    Hola scj2000-
    Muchas gracias por visitar nuestro foro en búsqueda de una explicación al cargo que recién apareció en tu tarjeta de crédito.
    Entiendo su preocupación, ya que cualquier cargo extraño que aparece en un estado de cuenta puede ser alarmante. En este caso, el último cargo que puede recuperar usando el correo electrónico que usaste para registrarte al foro, refleja que se renovó un antivirus Kaspersky. Esta autorización nos diste cuando realizaste la compra de tu Lenovo, desde entonces se renueva automáticamente la licencia de antivirus.
    Las otras publicaciones que has leído, indican lo mismo. Un cargo que se ha hecho a la tarjeta de crédito que se presentó durante la compra con la autorización del cliente.
    Lamento mucho la confusión y espero esto aclare tu duda.
    Atentamente,

  • I need help from chile and use a language translator to write and not turn my iphone4

    I need help from chile and use a language translator to write and not turn my iphone4

    http://support.apple.com/kb/TS3281       
    Not turn on

  • TS1717 This article is vague and unhelpful. My iTunes needs help from a pro. I have over 120,000 songs -- NO movies, TV, radio, or books... I have other programs which efficiently run things which are not audio-based. So why can I not get iTunes working w

    This article is vague and unhelpful. My iTunes needs help from a pro.
    I have over 120,000 songs -- NO movies, TV, radio, or books...
    I have other programs which efficiently run things which are not audio-based.
    So why can I not get iTunes working well?? It now takes at least 10 secs for any operation to be completed!
    That is just plain evil. But I am sure I could do something to help.
    All the music is on an 2T external drive.

    TS1717 as noted in the thread title...
    Brigancook, is the library database on the external or just the media? iTunes reevaluates smart playlists and rewrites its database after every action on the library. I've found this can make a library half that size, with a lot of smart playlists, quite sluggish. That said I'm aware part of my problem is aging hardware. Having the database on the internal drive may improve performance if it is currently on the external.
    I'd expect to see an exponential relationship between size and response time which may explain what you see. Cutting down on the number of smart playlists might help. If we're really lucky the long awaited iTunes 11 might have streamlined some of the background processes as well as cleaning up the front end.
    tt2

  • Java not working, need help from the pros!!!

    Whenever i go to a website that uses java (like runescape), the window that has the java is all white screen and on the top left side there is a little sheet of paper with a folded corner with a red X on it.
    Java doesn't work, please i need help!
    i am sure i have the current version
    i think it may have something to do with a failed classloader (maybe)

    when i click on the red X, and go java consol, this is that appears:
    +Java Plug-in 1.5.0+
    +Using JRE version 1.5.0_13 Java HotSpot(TM) Client VM+
    +User home directory = /Users/***********+
    +c: clear console window+
    +f: finalize objects on finalization queue+
    +g: garbage collect+
    +h: display this help message+
    +l: dump classloader list+
    +m: print memory usage+
    +o: trigger logging+
    +p: reload proxy configuration+
    +q: hide console+
    +r: reload policy configuration+
    +s: dump system and deployment properties+
    +t: dump thread list+
    +v: dump thread stack+
    +x: clear classloader cache+
    +0-5: set trace level to <n>+

  • Need help with java

    ok so i have a midterm and need help this question that is gonna be on the midterm. i dont know how to do it and its worth 16 marks!!!! here it is
    the UW Orchestra wants to produce a CD containing all the pieces of music
    from its upcoming concert. In order to do that, it needs to calculate the total length of time for the
    CD. In addition, the conductor wishes to know which piece of music has the longest duration.
    Sample output for the program.
    The Swan (3.88)
    The Bee (0.98)
    Claire de Lune (6.02)
    Liebesfreund (3.38)
    Ragtime (3.48)
    The total time for the CD is 18.74 minutes.
    The longest piece is Claire de Lune.
    Do not include the HTML that is required to embed the program into a Web page (that is, show
    only what you would write between <script> and </script> tags).
    [4 marks] In the following space, define a function, Print, that takes two parameters, Title and
    Length, and outputs a line of text such that Title appears in italics, followed by Length in
    parentheses. The function also returns the value of Length.
    For example, Print("My World",30) will output the line
    My World (30)
    and return the value 30.
    Put your JavaScript program for the remainder of this question in the space provided on the next
    two pages.
    [9 marks]. For each piece of music, your program should input the title of the piece and the
    duration (in minutes) for that piece, and it should output a line showing those values using the
    Print function just defined. After all pieces have been listed, the program should output the
    total length of time for the CD, adding in 0.25 minutes between each piece of music (which is
    needed on the CD to separate the pieces).
    [3 marks] The program should also output the name of the piece that has the longest playing
    time.
    Use reasonable variable names, indentation and good programming style. Documentation and
    comments are not required, but you may add them to explain any assumptions you might want to
    make. You need not check that the input is valid, and you may assume that no two pieces have the
    same duration.
    can anyone help me out! i would be indebt of ur kindness if u can help me out!

    This forum is for Java, not JavaScript. The two have nothing to do with each other.
    And anyway, this is your studying, so you should try to do it, put forth your best effort, and ask specific questions (on the proper fourm).

  • Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form

    I have a form (test) that I am creating in Adobe Acrobat Pro 9.
    I need help creating custom Java Script so I can get the desired answer.
    1) There are several questions in each group that require a numerical answer between 0-4
    2) There is a total field set up to sum the answers from all above questions
    3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
    Any help on what Java Script I need to complete this would be greatly appreciated!
    I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
    Thanks in advance.

    Have you tried the "The field is the average of:"?

  • Need help in Java Script

    i Need some help in Java Script,
    am using the following code :
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    if (window.focus) {newwindow.focus()}
    else {newwindow.close()}
    //     if (window.focus) {newwindow.focus()}
    </script>
    In HTML,
    thWorld Environment
    Day, June 5<sup>th</sup>,2005
    Am using onmouseover event, so that when my mouse in on the link, popup is opened....and when my mouse is out of the link, the new window should b closed....
    but according to the above code, the new window is opened but have to close it manually....
    Is there any other way to close the popup when my mouse is out of the link

    Prawn,
    This is not really a good way to make friends. With the cross posting and the posting in a wrong forum anyway thing you have going.
    Please kindly take your question to an appropriate JavaScript forum.
    Have a happy day.
    Cross post from http://forum.java.sun.com/thread.jspa?messageID=3797201

  • Need help on Java in sound application

    A good day to everyone here,
    I need help on using Java.My project is mainly manipulating WAV sound files with Java. There is some problem.I hope you all can help me. I couldn't find much info about Java in sound manipulating,sample coding or something like that. I need to find the command to
    1) Find each sampling point value in a sound file.
    2) Find the number of sampling point and the average value of the all the sampling point.
    3) Record the sound file in a different bit rate format.
    I dont know how to go about it.I really hope you all can help me, or direct me to any resources that may help me. Your help is very much appreciated.
    Thank you very much....

    i found this coding in a website n i not very sure that i understand it.
    can anyone tell me if i can find the sample point value of a sound file with this coding (byte[] source is byte array of the sound file).
    thanks...for all the help
    public byte[] executeAmplitudeTransformationInternal(byte[]
    source)
    int[] sampleArray = getSampleArray(source);
    int[] newSampleArray = executeTransformation(sampleArray);
    //convert 16 bit samples back to 8 bit byte[]
    return getByteArray(newSampleArray);
    public int[] getSampleArray(byte[] eightBitByteArray) {
    //create an array 1/2 the size (since every 2
    //8bit samples makes 1 16bit sample)
    int[] toReturn = new int[eightBitByteArray.length];
    int index = 0;
    for (int t = 0; t < eightBitByteArray.length; t += 2) {
    //read the high bit
    int low = (int) eightBitByteArray[t];
    //read the low bit
    int high = (int) eightBitByteArray[t + 1];
    //bit shift the high bit 8 bits to the left and
    // "And" the low bit against 255 to drop any
    //sign extended data in the top 8 bits.
    //refer to the tutorial for more clarification
    toReturn[index] = (high << 8) (low & 0x00ff);
    index++;
    return toReturn;
    public byte[] getByteArray(int[] sampleArray) {
    //create a new byte[] twice as big as the sample array
    //because it takes two 8-bit bytes to represent one
    //16-bit sample
    byte[] toReturn = new byte[sampleArray.length * 2];
    int index = 0;
    for (int t = 0; t < sampleArray.length; t++) {
    int sample = sampleArray[t];
    //this places the low byte in the array.
    //the downcasting automatically lops off the high byte
    toReturn[index] = (byte) sample;
    index++;
    //this byte shifts the sample 8 bits to the right
    //this puts the old high byte in the position of the low byte.
    //this way the high byte remains after the downcasating from
    //an int to a byte
    toReturn[index] = (byte) (sample >> 8);
    index++;
    return toReturn;
    public int[] executeTransformation(int[] sampleArray) {
    //create a clone sample array
    int[] newSampleArray = new int[sampleArray.length];
    //apply algo to each sample
    for (int t = 0; t < sampleArray.length; t++) {
    int result = (int) (sampleArray[t] );
    //add the sample
    newSampleArray[t] = result;
    return newSampleArray;

  • Need help with Java always get error

    hey guys need help
    this the problem i get :
    I go to certain websites and I get this error with firefox.
    This Site requires that JavaScript be enabled.
    It is enabled.
    This is the one of the errors in java script console with firefox.
    Error: [Exception... "'Component does not have requested interface' when calling method: [nsIInterfaceRequestor::getInterface]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "<unknown>" data: no]
    I have installed the java script from there home site and did a test and says everything is fine. Any ideas?
    please help

    Hi 49ers,
    Sorry not to have any real idea of how to help you out here, but this is a Java forum, not JavaScript.
    Some Firefox expert may stumble across your post and be able to offer some advice (I hope they do) but this isn't really the best place to post such questions.
    Try here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3
    Good luck!
    Chris.

  • Hi I am receiving thousands, yes thousands of eMails from APPLE Support Communities, In My inBox there is more than 26.000 eMails from these communities, and i Need Help from you, i will appreciate.I am not panicking but i've ever seen this !

    Apple Support Communities
    HI
    I am receiving THOUSANDS, YES THOUSANDS of eMails from ALL Apple Support Communities.I deleted some one thousand but still more than Normal.
    Please i need your Help.This is Enormous!!! I've never seen this happening! It should be a huge mistake that everybody from All Apple Support Communities
    sending me their complains? I think it is a big Mistake, or Something bigger, i don't Know! I just need Help in this moment. it's been more than three or four days
    i saw a number of eMails from Apple Support communities landing in my eMail address, should this be normal? I don't think so.
    I appreciate any Help
    Kind Regards
    & a Happy New Year

    Click Your Stuff in the upper right and select Profile. In your profile there is a link to the right to manage email notifications.

  • How to (make best) use external js library from html object (need help from dev)

    Ok, on another discussion about rotating full screen backgrounds slideshows, i was orientated to try a small lib named "backstrech"
    I throw myself in, and i really like what we can do with it.
    To use it simply, just make an html object and paste this in :
    <script src="http://musecdn2.businesscatalyst.com/scripts/4.0/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="assets/jquery.backstretch.min.js" type="text/javascript"></script>
    <script>
      $.backstretch([
          "http://dl.dropbox.com/u/515046/www/outside.jpg"
        , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
        , "http://dl.dropbox.com/u/515046/www/cheers.jpg"
      ], {duration: 3000, fade: 750});
    </script>
    then add the jquery.backstretch.min.js to your "downloaded files" (file menu > files to download)
    And you’re done.
    Now, i need some help from better developers.
    As you can see, my first line is a call to jquery, the same that we find later in Muse exported code.
    Reason 1 : without this line, jquery is not defined and the plugin won’t work.
    This raises 2 issues :
    - We load twice the same ressource which is useless (100k)
    - loading js is all about having the page hangs while it loads, hence, they are put at the end of the body.
    Does anybody know a way to load this particular html script AFTER we are sure the muse scripts (esp. jquery) have been loaded ?
    (in the Edge Animate world, i’d go for the yepnope, and put it at the right place in the code, though, here i have no access to page load structure except head)
    PS : in addition to that, i made an exported page/excluded from navigation where i put all the images i wanted for the background, i could then simply change the images lines :
    , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
    to
    , "images/my_image_name_as_in_ressources.jpg"

    Got it, there was a bug in my code. Here is what you do:
    1. Download the js file https://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.min.js
    2. In Muse: Go to File -> Add Files for Upload and add the script file
    3. Open Page Properties -> Metadata -> HTML for <Head>
    Paste this code in:
    <script>
    window.onload = function() {
    var loaded = function() {
      $.backstretch([
          "http://dl.dropbox.com/u/515046/www/outside.jpg"
        , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
        , "http://dl.dropbox.com/u/515046/www/cheers.jpg"
      ], {duration: 3000, fade: 750});
    //Load the plugin:
    var head= document.getElementsByTagName('head')[0];
    var script= document.createElement('script');
    script.type= 'text/javascript';
    script.onreadystatechange = loaded;
    script.onload = loaded;
    script.src= 'assets/jquery.backstretch.min.js';
    head.appendChild(script);
    }; //Window OnLoad
    </script>
    4. Preview or Publish = Done!
    Example: http://musebackstretch.businesscatalyst.com/index.html

  • Need help setting java paths?

    I have a number of java files set up like this:
    com.pogo.chess2.Applet, com.pogo.chess2.game.Applet, etc
    Now each class file uses the keyword: package followed with its associating directory, for example Applet.class would look like this:
    package com.pogo.chess2;
    import com.pogo.game.external.b;
    How do I create a new java project and properly set the path?
    Basically I have all of my java code in a folder called com, which has subdirectories with java files as well. What is a package? How do I set it up using a gui such as JCreator Le? Is there a way to drag the folder com to the project and all the files will load?
    Thanks in advance.

    For package, see
    http://java.sun.com/docs/books/tutorial/java/concepts/package.html
    The rest of your questions involve details of editor/IDE usage. None of them relate to Java. Read the information or Helps from the product you're using.

  • Need Help Regarding JAVA BEAN

    Is any one tell me that JAVA BEAN only used in WEB or also you in Desktop applications???? and aslo tell how i implement Java class and use JAVA BEAN. I need help regarding above matter
    thanks in advance
    Rehan MIrza

    Here is a good link that indicate that JavaBean is not only for applets
    http://java.sun.com/docs/books/tutorial/javabeans/whatis/beanDefinition.html
    quote:
    The JavaBeans API makes it possible to write component software in the Java programming language. Components are self-contained, reusable software units that can be visually composed into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as Beans.
    Francois

Maybe you are looking for