Java Problems

Posted by DesertFox on Nov. 14, 2006, 11:08 a.m.

Whee for JTextFields SCREWING UP.

I've got a beautiful simple encrypter/decrypter that uses an 8-digit hexidecimal value (12 decimal value). It works great, oh so fast. Much faster than anything in GM.

To put it nicely, it encrypted a 5mB file in less than a second.

Unfortunately, there is a highly annoying problem when it comes to saving the encrypted file - when it saves the file, it saves differently from as if you copied and pasted.

So, if I copy/paste into one txt file, and save that, and then also save from my program, the two files are different.

*pulls hair*

So I am currently reduced to copy/paste until I fix this problem.

I proudly present Hamlet's Soliloquy, the first bit anyway:

IBONHW?%w-ozAB‘©WÇÈ°]Xâ„¢ÛÇ?O¥Å¾Œ8¾È?á*'O fV“â€?z€ŸkLâ„¢ÛØ)?šýynUUV+5"™ââ€â€?I

0ëÚÖ¦œÃ…Lýõ÷ÅÅFSJâ€?‰â€ ?Ãâ€?îëQJØ…©¶Ã?Vg

Y¨6ðx~MKCI *x¾dgÃ?°§â„¢ÃžCñÃâ€?Ã?Q¥Ã²Ã¼'â´Å‚ˆˆÃ‰Ã¤ÃžNSÕÖg¨Ã‰UQ¹ï©–â€? /9ÝëO†+!"d8ß01ðï´ª/("g1'Ã¥9ðíº{õ)‘B[`~E0„˜I¬¥Ã‡Ã‡ È*浜Ÿ'ïPÀÊqRµÂ®˜˜Ã¥â€¢=?&>Y Çî÷â€?:

!N

ìý¡Ž J½þðæ?“ à4ÉÃ?–â€?ãðÓ†<=_N!Õ

ƺdlZ¤±ª

¹HNàîÅ}AKU?rv´bþ¿±4Úäq²â%‚?HJUU1Ã?lKlßØåäERi½‘BÃ?Ã?­akíêá«

HAMLET: To be, or not to be–that is the question:

Whether 'tis nobler in the mind to suffer

The slings and arrows of outrageous fortune

Or to take arms against a sea of troubles

And by opposing end them. To die, to sleep–

No more–and by a sleep to say we end

Qhe heartache, and the thousand natural shocks

Thaq flesh is heir to. 'Tis a consummation

Devoutly to be wished.

So I can copy/paste that to notepad, and vice versa, and it works, but it writes-to-file funny. I could save the entire things as hexidecimal code, but that doubles the filesize.

I am betting it has to do with ANSI/Unicode problems.

———————————–

No more html linebreaks.

Hoorah! Further testing shows that my filewrite doesnt write properly, for some reason! I opened a JPG image, and just resaved it, and iit screwed up completely!

This is a GOOD thing because I know partially what the problem is.

Comments

Flea1991 18 years, 1 month ago

Sorry dude, I'd love to help, but I know nothing about Java. :P

DesertFox 18 years, 1 month ago

Still, 5mb in less than a second. w00tness.

Damn ASCI/Unicode.

I'm probably going to have to have it make a *.ctx custom format with binary code or something horrible.

If I create the original text in the program, it can save and decrypt fine, but encoding screws it up.

Bleh.

shadowstrike32 18 years, 1 month ago

That encrypted poem is beautiful.

Arcalyth 18 years, 1 month ago

How are you saving it? The only way I've really tried is using a BufferReader with a FileWriter.

Alert Games 18 years, 1 month ago

I hate Java. If it runs in my browser, it will close the browser. So I never use it. And never did either.

Polystyrene Man 18 years, 1 month ago

Quote:
ìý¡Ž J½þðæ?“ à4ÉÃ?–â€?ãðÓ†<=_N!Õ
This line is so beautiful it makes me want to cry. Shakespeare is amazing.

DesertFox 18 years, 1 month ago

//How are you saving it? The only way I've really tried is using a BufferReader with a FileWriter.//

Same - I think it is whitespace chars messing it up - carriage returns, etc.

Extravisual 18 years, 1 month ago

I very much dislike Java. I don't feel like giving reasons.

shadowstrike32 18 years, 1 month ago

Hali everybody hates java. but in reality… if more languages had the same syntax as java everything would be easier…

HeroofTime55 18 years, 1 month ago

Actually, the first bit is a 0…