How Can I fix This Error....?? Please Help !!

Hi,
I can't seem to figure out how to fix an error I keep on getting. Here is the error:
C:\Documents\LZW.java:171: cannot resolve symbol
symbol : class BitOutputStream
location: class LZW
          os = new BitOutputStream(os) ;
^
C:\Documents\LZW.java:199: cannot resolve symbol
symbol : class BitInputStream
location: class LZW
          is = new BitInputStream(is) ;
^
2 errors
Tool completed with exit code 1
How would I go about solving this error?
Thanks alot

Hi,
Here's the full coded file: If you copy and paste it and compile it, you will see those errors.... Thanks
import java.io.* ;
import java.util.* ;
public class LZW implements Compress
          class ByteArray {
               final byte[] arr ;
               ByteArray(byte[] b)
               { arr = (byte[]) b.clone() ; }
               ByteArray()
               { arr = new byte[0] ; }
               ByteArray(byte b)
               { arr = new byte[] { b } ; }
               public boolean equals(Object o)
     { ByteArray ba = (ByteArray) o ;
               return Arrays.equals(arr,ba.arr) ; }
     public int hashCode()
               { int code = 0 ;
               for (int i=0;i<arr.length;++i)
                    code = code*2+arr[i] ;
               return code ;     }
               int size()
               { return arr.length ; }
               byte getAt(int i)
               { return arr[i] ; }
     public ByteArray conc(ByteArray b2)
               { int sz = size()+b2.size() ;
               byte[] b = new byte[sz] ;
               for (int i=0;i<size();++i) b=getAt(i) ;
               for (int i=0;i<b2.size();++i) b[i+size()]=b2.getAt(i) ;
               return new ByteArray(b) ; }
     public ByteArray conc(byte b2)
               { return conc(new ByteArray(b2)) ; }
               public byte[] getBytes()
               { return (byte[]) arr.clone() ; }
          public boolean isEmpty()
               { return size()==0 ; }
               class Dict {
                    Map mp = new HashMap() ;
          List ls = new ArrayList() ;
          public void add(ByteArray str)
               { mp.put(str,new Integer(ls.size())) ;
               ls.add(str) ;     }
          public final int numFromStr(ByteArray str)
               { return ( mp.containsKey(str) ?
                         ((Integer)mp.get(str)).intValue() :
                         -1 ) ; }
          public final ByteArray strFromNum(int i)
               { return ( i<ls.size() ?
                         (ByteArray) ls.get(i) :
                         null ) ; }
          public final int size()
               { return ls.size() ; }
     class LimitedDict extends Dict {
          int maxSize ;
          LimitedDict(int maxSize)
               { this.maxSize = maxSize ; }
          public void add(ByteArray str)
               { if (size()<maxSize)
                    super.add(str) ; }
     Dict dict ;
          byte[] buf ;
     final ByteArray emptyBA = new ByteArray() ;
     ByteArray w=emptyBA ;
     public LZW(int numOfBits)
                    if (numOfBits< 9) numOfBits=9 ;
          if (numOfBits>16) numOfBits=16 ;
                    buf = new byte[numOfBits] ;
                    dict = new LimitedDict(1<<numOfBits) ;
                    for (int i=0;i<256;++i)
               dict.add(new ByteArray((byte)i)) ;
          int encodeOneChar(int n) {
          byte c = (byte) n ;
          ByteArray nw = w.conc(c) ;
          int code = dict.numFromStr(nw) ;
          if (code!=-1) {
               w = nw ;
               return -1 ;
          } else {
               dict.add(nw) ;
               nw = w ;
               w = new ByteArray(c) ;
               return dict.numFromStr(nw) ;
     int encodeLast() {
          ByteArray nw = w ;
          w = emptyBA ;
          return dict.numFromStr(nw) ;
     void writeCode(OutputStream os, int code) throws IOException
          for (int i=0;i<buf.length;++i)
               buf[i] = (((1<<i)&code)>0?(byte)1:(byte)0) ;
          os.write(buf) ;
     int readCode(InputStream is) throws IOException
          if (is.read(buf)<buf.length)
               return -1 ;
          int ret = 0;
          for (int i=0;i<buf.length;++i)
               ret |= ((int)buf[i])<<i ;
          return ret ;
     public void encode(InputStream is, OutputStream os) throws IOException {
          os = new BitOutputStream(os) ;
          int next ;     
          int code ;     
          while ((next=is.read())>=0) {
               code = encodeOneChar(next) ;
               if (code>=0)
                    writeCode(os,code) ;
          code = encodeLast() ;
          if (code>=0)
               writeCode(os,code) ;
os.flush() ;
     ByteArray decodeOne(int code) {
          ByteArray str = dict.strFromNum(code) ;
          if (str==null) {
               str = w.conc(w.getAt(0)) ;
               dict.add(str) ;
          } else
               if (! w.isEmpty())
                    dict.add(w.conc(str.getAt(0))) ;
w = str ;
          return w ;
     public void decode(InputStream is, OutputStream os) throws IOException {
          is = new BitInputStream(is) ;
          ByteArray str ;     
          int code ;          
          while ((code=readCode(is))>=0) {
               str = decodeOne(code) ;
               os.write(str.getBytes()) ;

Similar Messages

  • TS1368 how can i fix this error:"please contact itunes support to complete this transaction"

    how can i fix this error:"please contact itunes support to complete this transaction"

    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support visit online support site.
    For iTunes: Apple Support for iTunes - Contact Us

  • I downloaded Itunes to my computer today to update my ipod's ios (4.2.1 yes i know im way behind) but when i click check for updates it tells me my ios is the current one. How can i fix this? please help!

    I downloaded Itunes to my computer today to update my ipod's ios (4.2.1 yes i know im way behind) but when i click check for updates it tells me my ios is the current one. How can i fix this? please help!

    and at the same time....
    I guess you can be glad that you at least aren't "way behind"!
    Cheers,
    GB

  • HT3529 I have just updasted to the IOS6 and now my Imesasages and FaceTime won't work at all How can I fix this problem Please help I'm deployed and that's how i talk to my loved ones.

    I have just updated my Iphone and Ipad to the newest IOS that Apple has available. And now none of my Imessages work or facetime. How can i fix this?

    Try giving your iPad a reset. Hold down the sleep and home keys for about 20 seconds. When you see the silver apple, let go and let it reboot and try again.
    How are you charging it? its's best charged plugged into the wall  not via USB. So if you're trying via USB, try using the supplied power block plugged into the wall.

  • I accidentally dropped macbook air that was in a book bag. The keyboard is working because I can see the light but the screen is black and it won't turn off. How should I fix this? Please Help ME!!

    I accidentally dropped my friend's macbook air that was in a book bag. The keyboard is working because I can see the light but the screen is black and it won't turn off. How should I fix this? Please Help ME!!
    I tried to turn it off and it didn't work... and I held on to the shift key too and it still doesn't work..
    Please help me..

    Accidental damage is not covered under Apple warranty.  And it seems there is much accidental damage.  Only a Genius Bar tech looking at it can tell how much it will cost to repair.
    Cost to repair will be high, I suspect (though Genius Bar will confirm/deny.
    There is no gentle way to say this sir/ma'am ... someone will need to pay for your friend's MBA repairs.

  • I can't open Safari. It keeps giving an alert that says, "Suspicious Activity might have been detected." How do I fix this?Please help. thanks!

    Safari won't work. It flashes an alert. Alert says that a Suspicious Activity Might Have been Detected. Major Security Issue. How do i fix this? Please help. Thanks!

    You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • Can't create apple id...account limit reached...i have just bought this iphone second hand.. how can i fix this problem please

    can't create apple id...account limit reached...i have just bought this iphone second. how can i fix this problem please.

    appleid.apple.com
    ^ There's your website, go there, create apple id, smile
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    There's the link part of it , Bigger smile

  • Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    - Try another payment method.
    - Contact iTunes
    Apple - Support - iTunes - Contact Us
    - Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • My itunes just pinwheels forever and never loads. Ive tried force quitting it and retarting my computer. How can I fix this ASAP please?

    My itunes just pinwheels forever and never loads. I have tried force quitting it and retarting my computer. How can I fix this ASAP please?

    had similar issues with my macbook(2010 running lion) and after a few restarts it would not restart anymore and is at the service center since saturday. i would suggest you do not use iTunes until this issue is addressed. seems to be macbooks that are having freeze up issues.

  • Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Standard troubleshooting...
    1. Try a Restart by pressing the sleep/lock button until you see the slider.  Slide to power off.  Restart by pressing the sleep/lock button until you see the Apple logo.
    2. Try a Reset by pressing the home and sleep buttons until you see the Apple logo. Takes about 5-15 secs of button holding and you won't lose any data or settings.
    3. Remove apps from Recently Used list...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Swipe up on the app preview card to remove it from the list
    - Press the home button when done.
    4. If still a problem restore with your backup.
    5. If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
    6. If still a problem, it's likely a hardware issue.

  • Im Using iPhone 4 factory Unlocked device iOS 7, but device was feels slow, so i want to restore to iOS 6.1.3. how can i do this? please help me anyone itz urgent.

    Im Using iPhone 4 factory Unlocked device iOS 7, but device was feels slow, so i want to restore to iOS 6.1.3. how can i do this? please help me anyone itz urgent.

    As has always been the case, you cannot go back.
    Sorry

  • Hi! My friend offer me a iphone 4s upgraded to ios7. The phone need and icloud account. and my friend didn't remember his email address and password. How can i bypass this. Please help.

    Hi! My friend offer me a iphone 4s upgraded to ios7. The phone need and icloud account. and my friend didn't remember his email address and password. How can i bypass this. Please help.

    Sorry, there's no way around Activation Lock. So, give the phone back to your "friend", as you will never be able to use it.
    Apple can't/won't help you.

  • I've changed the name on my iPhone, but it still sends messages in the old name, how can I fix this? Please?

    I've changed the name on my iPhone, but it still emails in the old name. How can I fix this? Please?

    Change the name in the e-mail account settings.

  • HT5622 my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    Hey nocillado,
    Thanks for using Apple Support Communities.
    It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
    Get help activating your iPhone
    http://support.apple.com/kb/ts3424
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using the same Apple ID for Store purchases and iCloud (recommended)
    Have a nice day,
    Mario

  • My Ipod is disable, How can I fix the problem please help

    My I-pod is disable, how can I fix the problem, Please Help

    If it is disabled because of the passcode, see this article: iPhone and iPod touch: Wrong passcode results in red disabled screen
    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software.
    If the issue continues after updating and restoring your device, refer to this document.

  • My ipod touch was interrupted during an update and now my itunes cant recognise the device, and ive tried to restore it but it just keeps coming up with the usb and itunes picture. how do i fix this? Please help

    my ipod touch was interrupted during an update and now my itunes cant recognise the device, and ive tried to restore it but it just keeps coming up with the usb and itunes picture. how do i fix this? Please help

    http://support.apple.com/kb/HT1808

Maybe you are looking for

  • Can I use my 160gb iPod classic as an external hard drive for my MacBook?

    Can I use my 160gb iPod classic as an external hard drive for my MacBook?

  • Problem with Win_api_dialog.open_file

    I am trying to use win_api_dialog.open_file in a when-mouse-double-click trigger. I have attached the library (d2kwutil) to the form and placed the .dll files (d2kwut32.dll and d2kwut60.dll) in the bin. The code will compile cleanly but at runtime, I

  • Billing printing

    Hello I need some help about a strange problem during the print preview of different billing in a EHP4 FOR SAP ERP 6.0 / NW7.01 . In SP01 i see the spool with (for example) 6 pages to print. In print preview , i can see only 3 pages. If i print with

  • Unable to login Windows 7 after disable Veriface 4.0

    Hi all, i accidentally activated veriface 4.0 in my Ideapad U410 but find it useless and disabled it. When i try to turn on my laptop the next day, was asked for password which i never set one. now im stuck at windows login without password and do no

  • Why is there another cell # on my statement?

    It doesn't match my current cell #...Not sure why.... Because that number is not mine... And I am not paying for someone else's services. And also why it take about 10 emails and like 10 hrs to send 27 pics from cell via email to my desktop? Not sure