十六进制转成图片
/**
* 十六进制转成图片
* @author Administrator
*
*/
public static void saveToImgFile(String src,String output){
if(src==null||src.length()==0){
return;
}
try{
FileOutputStream out = new FileOutputStream(new File(output));
byte[] bytes = src.getBytes();
for(int i=0;i<bytes.length;i+=2){
out.write(charToInt(bytes[i])*16+charToInt(bytes[i+1]));
}
out.close();
}catch(Exception e){
e.printStackTrace();
}
}
private static int charToInt(byte ch){
int val = 0;
if(ch>=0x30&&ch<=0x39){
val=ch-0x30;
}else if(ch>=0x41&&ch<=0x46){
val=ch-0x41+10;
}
return val;
}
public static void main(String[] args)throws Exception {
String str = "ffd8ffe000104a46494600010101000000000000ffdb0043000c08090b09080c0b0a0b0e0d0c0e121e1412111112251a1c161e2c262e2d2b262a293036453b30334134292a3c523d41474a4d4e4d2f3a555b544b5a454c4d4affdb0043010d0e0e121012231414234a322a324a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4affc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a7374" +
"75767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffc000110801e0028003012100021101031101ffda000c03010002110311003f00ba918a942522c936d285a0076da5c5003b14ec5310ec53b14863b14e02810edb4f0b400edb4e0b400e0b4e0b400fdb4f0b4089a38c1abb1db2e39a6225f293d290c29e94088a4800e9559a3a4319e5d30a5031bb6936d031bb68c5001b69bb29806da36d200db46da630db46da0036d26da0418a4e2818dc8a322802418db49c5021714b8a005db46da005d947974085f2e9de55002f9147d9fda9888da0a88c548637caa6f97400d2949b2801bb29bb2818dd949b2801bb69bb6801a569bb6801bb69a568019b69bb6802198ed159eccced400be41349f67a43351569df7450033cea9629375004f8a5c5301d8a5c5210a29d8a00900a705a0076da7eda00705a76da006eec54abcd00498a035311622abd1b71408928a042119a81a1a43233154663340c61434dd940caf26476a233ba801f8a31400bb6936d001b68db4c036d1b6800db49b6802adc4bb0e0556677f5c5201eb196ef46ce7ad30253110bd698378a0448929ef56d466801db690500213f362a50b408784a551938a605d48828e69db17d295c9219a118e2a8ba628288" +
"f6d308a006eda6e298c4db4dc50026da4db48626ca694a006f9749e5d0037cba6f95400c31530a50328dd2556822f9a8116bcbaa97076d0068e6a0924e7140c7ac408a85ff0074d480b2b73f2d1f6aa0078baa99270d4c43bcc1479d4807c538ab6a73400f14e06801d9a6c8f8140106775496f260e2811699f8a676a009ade5ed56e37e79a622c2481a9f484145032391c2d556b95a6030dc2520995a8190ce411c555b77da4d201fe67269b15c8cf3401656556a7e698c28c8a4014669805250232ee39bac536f005028026b6947955046fbeeb140172e1c6eda293c918a00163357a2e0500399801551e755a04402e32d5760b8cf1408b6ee36d3ad17277512d845aa2818c91c28acc966dcf4091179c054067dc69941e760543e76ea0077da30b51f9f9a4038ce02d4427cd318af718a689a8006b80293cfa006b5c8a04d4807efa8d8d0053b9a820eb40168f4acebbeb401776f154a4f964a0a2e23fcb514bf3d201814e29e22cad002c7153954a9a604bde9fb72d480718f1d2af43d28113814a05031f8a8a61c502190ad3d57e7a009dd78a7a8f96810912fcd56698166043d6acd020a2a797502b5da7cb54bca256981024672698a0acd8a064cf09350343b05030488ec35562872e69812a0293e2b400a4018a314c031462800c52628032e71fe974fba5ce2811576b2b6d153dac5fe9540134aa7cfcd5b18db4085" +
"18a99466801255e2b2e68cf34010221ad1b088934c46afd9f775a9d142285153d407546ce738a6057b8cedacc0a771a63209739a646bc5202293342261280217c9a902e128190365aa4db85a0644d4dcd020da4b50e314010b66a58726819682d34ad0054b95a8215e6802c91c5675da9a00d2cd413c5bba5228af861c52c6ad9a045c0b95a91138a603912829cd002ece6a40bcd0048cb53c5408981a706a06381a1fe61484565254d584a044d9c8a6ab91c530274c629f19f9a908bebd29698828a010c97ee1a8531b68190ae37540ff00ebba50059e3155ae290c3fe599a82d873400d7ff008f8ab8a78a0076693340c37519a620cd2134019d7311326e151339cfcc2801eac99ab10f97b8b5002c8e86a1f357b5021c1cb1e95a309f968009dbe5e2a9b8fddd00408067a568d8100d311a3b8526f14c42960066abf9c0b50012b02b59ee769a4320fbc6999db40c8f19a693b450046a94ac7e5a0062a52b9f96819115cd0571480054729cd0322db96ab116050058a69a0453b8a82223340cb3918aa92a6e34089719a70148b1db334a1281122ad3c2d031c169db6810edb4bb6801fb6940a403e96980ea75200d99a7aad310f029fb2802544a9952811697a52d31051400d3d2a2db40c8ca546d1d200db4d64cd03136f14d11e2801a62e69f8a60262931400628a402e2931400d299a618298119b6f6a7adb7c9d2810c" +
"fb353d6dbda802558715305a000a6691a1cd021a2daa68a1db40164251e5d3103a6454021c5002321aaef0d0319e5544d0e68010c55118326818a62e2a2f239a00531547e450314c551f93480468e99e450031a2a548b14012e29a6811527526a99056818e1291d69fbc1a009a9f9a92875385310f14f1400ea75002d3a80169d400b9a506818ecd3b34087034f06810f0d522b0a404cae2a75714c449b852e6800a281099a616a0630b5377521899a6e6980dcd19a004a6e6800a4a0028a042d1400514c02a4fe0a006d140870a5cd003b34ecd003854808a0075140829a5853191b30a898d00464d309a40464d3334c6253680129281894da006d34d201bc536801a4d349a0089aabbc6281159e3a84a9140cbad51a3f348a26ce2914d00585a905003a9d408751400ec52d031696810ea5a403a9e280169865c531124336eab6b400fdd8a6f9f408b31bee152500308a8643b69009f7a93140c4c52629815252c29d6ee5c5004f8a4db40c4c518a042628c5031714628106297140062a422801bb68c5310bb6976d003b6d382d003c253f65021d8a31400856a32b40119151914011914c22818c229b8a06371498a004c537140c4a4a006d34d00329b400d34cc502186a263401193519c5032c1e455493e57a4326dd95a7c239a00b6a29e2810fa5a063a968016978a403a8a603a96810ea750023f0b55e239340879f924" +
"157e26e2900b337cb5556714c45ab492aeefa044135ce38154ae2e4f7a00944fb63cd466f0f5c50313ed9b8702a482e44940c6cccac0d45647ad022fd2503128a004a5a0028a0028a00753a98094502169d400e069e08a043a8a0028a0414d2e28191171519614c08c9a613486479a4cd003734dcd002669b9a631334d2690c6934d268019494086d309a0089eaa4af8a065632533cca00d402abdcc7c5228821cd68c2bc5022c014b8a042e29d8a0076da5c5031714b8a403b14b8a005c52d310ea762801b20f96aac3c350048fcbd5c8ba50212e0902a258815a0092d320e2b43b502289ff005b45d20c0a006b8fdcd0b1661a0636d22e0d10c789cd00597b6dd4b15beca064bb68db4084c518a0036d18a003146da0036d1b6801714edb4c04d946d34085da68da6801d834b83400ee6979a041cd273400c34c6a008e9a6818c34c3400d34da004a6d03129b4c04a6d031b4dc5201b4940861a4c5032192a93a1268022311a6f944503358629fe5ab0a422216e01ab2a2801e296801d4a2818f14b40053a810ea5a00296801d4b400ee2ab496ff3656801638bd6a722810e65deb8a8551978a04598176d5acd032b4f165b72d466377eb40139837478a7ac1fbac5201b041b29ab0e26269816b14b8a4312929884a290052530168a0029681053a800a2800a334c05cd2e6810668cd0019a322801a48a61c50030e2987140" +
"c61c530d0034d36818da6e280129b400da4a06369a680142134c38a006534d02232299b050318569a505004b8a78a431f8a7014087629c16818fc52e2800c53b1400b8a5c5301d8a5c5210b8a5c5003b14edb400b8a76da005d94bb6801db69db2802454a704a4049b29365301d8a5a430a4da2800c518a62136d376d020db49b6800db49b6900bb68db4c05db46da005db46da005c518a602814b48028a60145020c526da006eda3650030c75198e819194a4d9400d31d37cba005f2851e52fad031be52ff7a9be52ff007a8013ca5fef52fd9d7fbf4001b61fdf151496fb3ad0046ce76ed1501a0061146ca008dc85aae66c9a000518a00989c5576b9c1a40392ef9ab914aac28026e29c08a063b228c8a042e453b3400b4a2801d4b400a296801c29f400ea766802192e163a44bb563480b218531ae5569889a09d64e953d00212075a5a0614ddebeb48075140c28a041453105140828a401450014500145300aa97f70615e2802b45792bf415605c4be94013452337514e964f2e980f53919a5a002992482319340154df8cd3d6ec1a0095260c69971304a065537429bf691400f136ea4799568019f685a3ce5f5a004c834c6751fc5400c59533f7a9e644ecc2800dcb8ebcd34b6eeb40c475e2a2db400118aad71701050065c973e6360549147dcd004bbc0a6efcd004ce38aa471bf9a432528a452c7b92801fe7bd2ad" +
"d39a009e3b82695e53da8018970777353b4d8a0402e3774ab51f34012d2e2801c052e2818a05498a042e28c50066cedfbde6a680a31f7a00b8ff002c7556dd3cc340878530dc56a2f4a064375c2d2c72809cd003e43fba26a3b65cae6900b39f2f0452aceac28287890138a7d0485140828a620a2800a290051400514c02b37571c0a005b19635400d5cf3a3a6048ac1ba557bce8280278fee0a75030aa5a8678a045688263e6ab03caa00b1122f6a24803d032bb5a28a60b65340127d9b68aa13afef28024585714be4ad003f600bc0aa7345ed40c844633d29b20db40875b65aad628196961f323aaae3650050bab8d95912cc666c0a009eded36f2d4f964da30280228a36739353b0d940cb2fd2a9984335022c25bd4863c5003028a150668014e01a697cd00459f9aadb1063a4057b620495b116314012d3a801c0d3a80169c0d003a9491480ac638ddaa0b8882382b4c45cce6de99638a002739b8ad05fba2802bdf1c45542da4225c3d006a4bfea4d56b5593d78a00b12c5bd79a821c21c62917d0598fef178c55ba64051484145001450014500145020a2980550d57ee0a0632ced919326adfd963a60491c610714491f9940878e05140c2992209170681145ecf9e1aa36b728339a064b632fcd8ad0a00ad7afb52a2b27cd005c7e958d76d8938a06357cca70f3334016a31f2f355eeba50064bceca698acf2b5006a" +
"dbc5b00ab2ebde818453f974b34f6f2f53834019377676f273f68aa515bc50b6739a062cf38c7155910b9a01179711ad50ba9f736050234f6669a21c35032c2ad2b266900c10d020228006b7cd42d68dda80105ab54df6634083ec7dc55c85481401362971400e029d8a005c5380a40380a5228029cb0caad94a58e191dbe7a00be90fc98aa6d6f2c4ff00274a604b0c0c5b2d5780c502239a3df501b5c8a4325dac62db4f85762629812555d8c936719148092542e54d4d4005140828a041450014500145300a2800aab7d6e675e2802a25a5c274352886e29813dba4cadf3f4a927dfb7e4a00adfe93487ed3e868b812dbf9dbbe7e94eba3201f2500512d71e86a3733b0c60d005ab0b765f99ab4280295f8256a3b15205005d7fbb58d759f328182ce476a5fb47b530278e42f448991480ceb8b6cf34c8176b5006b45f326297630f7a06433ec03e6c8ac2bc74ddf296a00640734b70dc7140cae80b9aba0045a00a57329278a8e08f2726811b829e314863c629d91400b4ee2810ea38a0038a5e28014629dc5003a9d9a007034b9a0076452e680240452e45201c3069ea05310ea281851400514861453105148028a4014532428a0028a0028a0414500145318514005140828a630a4c8a005a2800e2938a005a28018c50f5a45641400edc08aaed1a31a0627d993d29bf664f4a0050aabd29af8a0080e1a9a205a00900c" +
"53249ca0a00c4bfbe7638cd514432f5a0a42b1f2f8a233e61a00bbb1635cd52b8bae71400b0a6fe4d3a691621c5026690a70a431e29d400a29c2980ea5a0029690870a5c5002e29d400a29d8a00753b1400e145004a9522d201f45318521a042d1486140a0028a0028a0028a090a2800a28105140051400514c028a0028a0029b236c4268194c79d3f3da97ecd2ff7a8025822743f31a9265675f94d0055fb3cdeb4c68a75e6980fb599b760d1a8ced18c2d00672fda24e4529fb42f5a044b05c35316e18cd8a066b47f76a2b86d828029c72b1355aee6753c500545b99735623b86ef401711f70a8a719140cc3bb84efcd57f3b650322cb486a45cc540c24ba278a8d212e7340133c8204ace790ced412751baab493e0d21935bc9baac93400c0f8a77da1077a043bed294e59d4d003fcd5148b7087bd004c185381a005cd2ee0280186e1054892ab5004a08a7034808e79762d52324a7e6534c45eb1b9debcd4d34fb78140c83cd910e7b55c12295dd40102dd86976d5aa0028cd200a2818514005140051412145020a2800a2800a2800a2800a29805140054771fea8d03083fd58a9280182405b14fa008a49c47d6a17bc5c7029888ad14b4bba8d47ef0a0658b451e574a5ba03cba00c84fbc6a387fe3e68037e3fbb55ef0fcb40ca3075a2e248d7ad022b8961348d2276a009edfa54ad40ca9711822b06ed36b503190c8" +
"a9d692e2e55ba500540ff355b5bb5514015ae5fcee94b6b1ede4d203a1db50cb1d301f02e2a593a5202b126a33196a6031613bbad4ea850d201ef96348612391408bb6c4e2ad0a062d4730e3ad022bed4f5a554dadf235005f8fa54b8a4055bde94e857f7740096a3e7a966ff5c298161d7f7145ba6f4e681918842dcf157a810d9384354d1249727340c746256f949a7425d26d8dd29016a8ef400514005140828a0414500145001450014500145300a290053261ba338a06450c9b570d5219d077a6220b63ba526add03239a2122fbd6708f64b86a0469a636fcb54efc7340c7dbcc8a98269b75709b3ad3119d10dc6a2dbe5cf9a00d686e576d4377329140cad0555bc8cbc9400f8ac38ab4962168026f2f6d46d40113ae6a95c5a86a40615ec3e5b5534196a065a644d954253f35302c5be3bd3e69b8e2811d354725218b0d3e5e94015a9ebd28005fbd4e3d68022924d8d5209c38c0a045bb7ab62818ea8272bde8114cf955245e5eea00d38ba5494015af47cb9a863b9411e3bd0225b5700e4d4b7070e1a819234ead1e05588061280233ff001f15629008df74d362fb94002756a69ff5e28064b4500145218514c90a281051400514005148028a6014500145030a2801ac8add4537c84f4a0072c6a9d29d4c02a3921593ad031c89b0629b344255c1a00a86c3de98da793de802782d04429925a87340111b23daa336" +
"4d40c9a2b6d82a192df2f9a60598c60549408631a81a8023a638c8a00ccbbb4f32b1ae2d4c348652676cd2ac3bb93408493f77d29205f30d0075a053b6d03142d3b6d002796297cba005f2a9de550056920cb722a58ad5476a00b2a98a92801c290a6eeb400cfb2afa5385b283d2811615314ec521815cd406c1376714c4594b65c549e402b83400d4b3553564714863760ce69d4c4145218514005148028a06145020a2992145200a2980514005140051400514005140c28a0028a6014500145001450035a9145301f498a431a4540e298118a750046d50350036928018eb9acfbbb6de2811877364c8738aa8f232d218b1c4f39e95a96b61b2803685385003a9d400b4b400b9a75020e29e31400b4ea0628a771400e14ea007d2d20169dc531122d3a800a28185148028a0028a40145030a2800a282428a041450014500145020a298c28a0028a0028a061450014500145300a2800a2800a41400b450310d40f4c060a334011b1a84d201b4500369840a00ab710861d2b226d377350059b4b311d5cc0148029f4c05a7503169680169c2810ea5a005a75003a96801f4ea00753a80169d4809169e280168a6014500145200a28185148028a06145048514c4145200a28105140c28a0028a60145200a29805140051400514c6145001450006982801f4d3400c3513d00474500466a23400da280129a680186a22281898a6bd0" +
"218264f5a779cb400ef3969de6ad002f9cb4be6ad002f9ab4ef356810ef35697cd5a063bcc5a7798b408709053bcc1400ef3053bcc1400ef3053c38a063b78a5f305022459169fb850019a5a0028a40145030a2800a2800a290c28a041450485140051400514005140c28a0028a0028a0028a0614500145300a2800a2800a4a602d1400c3513d0047450046d511a006e69b9a004cd349a006934ccd002531a8038917f37f7a9dfda137f7a810bfda137f7a9ff00da137f7a800fed19bfbd47f68cdfdea601fda53ff7a946a53ff7a8017fb4e7fef53ffb4e7fef520146a93ff7a9e3549ffbd40c78d567fef53bfb567fef50028d5ee3fbd520d5e7f5a005fed8b8fef53c6b33fad002ff006cdc7ad21d6a7a42274d6a7c75a7aeb73fad31930d6a7a906b33500483599a9875c9f34089575c9a9dfdb92fa0a009135a94ff0008a946af27f745218bfdb0ff00dc156aceff00ed07057141515765ea2a6e6fec828a05ecc33499a2e2f642e68a2e1ec828a2e2f64c28a03d930a3340bd930a280f66c28a62f66c28a0391851407230a281728514c39428a02c26e14df30502b0a5c5315c6698587ee14858501618585412350043e60148675f5a0923332fad44665a006f9ebeb4df3d7d68013ce5f5a6f9c3d6980d328f5a6f9a2900798298d20a00e0b34ecd040669d9a061ba8cd0019a5cd30173cd3a900e0697340c7034ecd0" +
"00a6a40680173466800dd416a00951b8a7ab5004a1aa557a0a250fc5445fe6a044c8dc52e6801eaf8ab0b25002eead1d21be7a4cd21f11bd45667685266810dcd1400668cd21866973400669d9a0046a8f34c0334ecd0028a76681099a33408334b9a004cd2669886934c2d4086eea4268111b1a8f34c0467a6a31a044bbe937d310c2f504b21c501632ef2e196b3daf1fd6998c861bc7f5a635e3ff007aa88213772fad30de4bfdea0437edd2ff007a93edf2fad1710d6d4a5f5a61d4e5f5a0070d4e5f5a636ab2d0233053f1408314ea06251400b45201c29f400e14b4c63b14ec520045a93140c5db498a041b6908a00913a53c500482a55a6324a87f8a90cb912714e64a00402a65a007f6ad2d187cd49970dce828e9599d844f2afad46665f5a09b89e68f5a3cd5f5a02e2f983d68f307ad0170f307ad2ef141571778a5de28006614cdd400b9a5dd400e14ea04333466800cd3969885a4a0434d44f400d5a53400c34c34c446d4c534089734940861a825e94018d7f596c6a8ca6465a999a66414c634010b1a66ea6046e6a3348914546d408629a901a6014ec1340c3635379a420a5a007034ea063852d031f9a4cd004b12b374ab02da4a006bc6e9d6a3268019ba90b5022656e29775031ead532b5031fbaa2cfcf401a1112053989a0647deacc2680273d2b4b45fbd499a43737aa9ea326c4a84744f639cbab971fc" +
"46a9fdb64fef9ab392e1f6f9bfbc6a55bd97d4d215c71d41bfbf503eab20e8f4839841aa4bff003d2a41a9cdfdea07cc4bfda52ff7a9cba94dfdea63e6612ea9301f7aa1fed79fd681f39226ad39ef577ed93ecce69073b122d4e535763bc918501cecad3ea522362983567a07ed18adaabd4b16a8e68b073b24fed26a3fb45a9d839d89fda2d4c37ecd40b9c67db9853d6fd9a81f388f78c2a03a81a039c865d4b02a18f5425a987316e3be2c6b4227dc2a4a8b1c6abcd41a18d7f594d4cca440c6a22d54643b7d46cd484464d36a8446c69869085a63502225a9945302c450eeab42355a450edaa6abcf077a00a8452502169d400a29c2818f1534316f6a00d582108b52175140c74910912b2678f6b5022b9a69a62265e94e140c7ad4ab40c9b191562d6c0b9dcfd2901ad1d9c6074a6cd6631f2d00673210d534429944add2b4f44eb50cb86e7402b3756fb952744f6397bcaa40126a8e334edecc05dce39a9498c71c504105cd9891329d6b0a5fddbed6a631b9a963739e6908b79e29ca6818afce6a2c5031cbc1ad9b4612c540122d97cdc55c1179694c0cbb9f99ea255a0049f814e83a5004d4b400d34cdfb4d032cc6a1c549e562908827381545e98cab70ad8a820043d219a9075adab7fbb4171253504d48d8c5bfac97a68c6640d50bd51911d148421a6d3018d51d021d4c6a04316a74a6334601f2d4370fcd031" +
"2dc926ad4c3e4a04673f5a8e900ecd148428a9169943c568582834017ae1b6256617f9a828d1b7ba8c2726a9dcb2bb645022b1c546f8a04397a53a988923a9d69145eb340ef5af811ad022bfdaceee2af40fe627348650bb4c3d468298c7356a68bd6a59a53f88deaced5bfd5d49d153e1397b9e6996a81a5154713352edbca809ae6e797735324d8d1d8cb07cdce2b335b8c2dcfd68033776da95255a00b314a318a9d1a90c9f01a90c540c4082acc44c7f76803421bc38e453de7320a622b94cd4657140cad7069f074a404f4a39a00422a19d78a004b5764ab4676a60577cb75a89b8a43219e7c0e955567dcdd28197606f9ab72dcfcb41a409aa197a523531750ac87a68ca642d503d5189153a8108699400d6a8cd021d4c34088d6ac4239a606aa0f92a85c7dea0a27b25c9ab375c250064c9d6994123853a90053d698c9056b69a99a4334dad9641cd4274c8cd3028dcd9bc3f4aa678a40459a61eb4089074a7e6819245530a066969bfeb2b5aea3263e28119cb6f27f74d4eb2bc5c5051148e5cf351a1e6801e4d6b689499a4373785666adf72a4de7b1cd5c52580ff004814ce36686aa3168d5cab9e6992743e1f53f673f5acfd7c7fa55006338e699cd3249626ad18a9148b71d38b52286ad4e80b5005d8eda4fee9a7152bd450212a37a6051b9eb4f84f148097754b19a0057350cbcad318db68d98f02ae7d964c" +
"74a405791193a8aaeed40c8a5b62eb557ecc50d005880fcf5bd6df76835813d432d235313513594f4d18cc89aa07aa3222a5a04284268f29a90ec21b773daa3781c76a0561361a3ecefe945c562bad59b7fbd5406b0e23acd9cfcf4016ac6a5bd3f2d03329fad329123e96800a78a63245eb5b9a5e36d005bbabbf256aadbea6cd2608e290cd1980961ae76e576b9a04414c3d6819276a05004c95203cd0335f48e65adfe3bd04b013439c64532eadd245caf5a00c597e524544a682c7935b3a174a4f634a7b9bc2b2f58ff57508e8a9f09cd4e69fa61ff4915670b3475b3fe82d5c8134128ea7c378fb2fe3597e24ff008fba0462b1e69a7a5031b0fdead587ee8a068b41b834ddf486111c9ae974db45440cdd6802f7da204e0914e78a39d2811913c7e5b91559a8194ee17349174a0096a48e980ad4cfbc40a43362d2158e3a95a4407140882e235912b9fb91e5be281a2b4b33638355bcd6279340cb1037cf5d15afdca0d2058a864e9526c61ea46b2da998cc898d444d5191152af5a6235f4e811cf22b57ec31fa54d8b0f2215ec2a39aca2907028b015974e453530b68476a56038c1566dfad686469ff00cb3ace9bef5032e590a7def4a4065b75a4a042d385031d8a5a063856d699f76810dd48f354ed5b128a06746bfea6b9fbdff5a68020a8dfad021c0d380a064ab45319afa21fde1ad6d425290f148931a290e7" +
"ad74768c5a119a0a32752f96635490e4d0327d86b6f455c2d4b35a7b9b42b2b593fbba946d53e1399b8352e95ff1f42ace491a3ad8ff00416ae43bd066755e1cff008f4fc6b2bc47cddd006290734d3ba980e87ef569c5498d12e7834da4513d90cce9f5aeae43e5db123d28118418b364d6ce9b36170c68023d44867e2b3989140152e18d320e9401354894c60d4b07fac1480da1f72b1a766f3a8117e3398b9ac4d4bfd750318ab098fe6350b470f634ec31605fde574b6483cb1525a2d7962a196318a0ae6303564c5631a6432192a06aa2068a72f5a00dad2fad695c4db12a4a3125bd7f33ad68d95c175e698875e5c6c5e2b23edcfbfad0231055880fcd5441a80e63aa9221dd48a2dda2e0532f4d00669eb4668245a3340c3751ba980f56adad29c6290166fadfcc1c554b4b27f33247140cd96c2426b9fba20c868023c8a8dcd201a2a6522980edd4b9cd006be8b80e6b4355c98b8a0463275ae96c78806681b327546fdf1aa70b60d2196fcc18ad9d18fcb499ad3dcd91593ad1f92a51d153e139c96a6d2c85bb5ab3899abac2eeb27dbcd71fe5fcdd2824eb3438bc9b41bab0b5f60d7c6811945c0e29a64f6a007db265b75684752521feb498a6516b4e1fe909f5aeadd7cc876fad0495134c5fef5326b468b91480aa4d34d31942ee92dfa50058a9168006a583fd60a00d8fe0ac69bfd65022fc5feaab17511996" +
"81946446c54080e6828b96ff007aba0b46f9291a44b1b8d43231c50696307536e6b30d0632dc824a81aa8cc414e1d68036b4cab37edfbba4339f73fbcad6d3cfcb40213516e2b1d4fef2988cf5a910e29925fb79fd6ae06434c60d32a0aa13cbbcd00566a65210f14b4084a6d031e957ace5f2da811bb6f70aeb53f98a2828a37b7831b56b34f348088f5a8cf5a621681401253968197ec66f2a519e95d10db32734088bfb3d3766ade7cb4a06605f3799231aa684e69145b8f735743a2a109499ad3dcd8ac9d67eed49b4f639d98734c8c9470c3b551c86f5addace986eb4ff00b25beeddb0668208af2f63b5888079f4ae52e374d2339ef4c0ad22fcd4f48b775a405c450ab5220a450e0339a902531966c17fd216ba3793cb8f26824a0ba9b6fe9c56ac3209e3a00c9bb4d921aad9a45152e6883a5004d522d3011a9f6ffeb052034ff86b29f992988be83f7759574fb27e940c866bc4c7ddaa26e4337dda404909cbd6f5afdca46b12c545274a0d8c2d4fad665330991c955daa8c86d3d7ad006c69b56350ff005748a301fefd6a587dda62417f593fc7484670a7d5103c3549e6b7ad30137934521886905021f499a002931400a2a556a009964614ef3dfd4d030de4d1bb8a0069a6f7a00752d0048297a5031e25c55fb4d55a2f958645005ffeda8f1d0d559f53697d85202bb4d9a8d0fcd414745e1e896590ef19ae9d" +
"6244fbab8a438ee2375ac6d67a549d53f84e7e66db5179a2a8e4144f8a7fdadf1f78d022b31dc72681c76a008f68df9c53f8cf14844952a6da06239dbc8a679a68196f4f7fdfad6bdfcdfe8f4099950bf35bba7bfeee981475097f7a6ab03ba90115ca0db5141d28193d480e2801a5aa48186fa00be651b0d676efde5022fef1b2b1af799281956484b2f154fc920d219341f7c574369f70506902c9a864e941b189a9d659a1184f7236a81aa8cc6d3d7ad311b1a6d58d43fd5d228c07fbf5aba7f4a04875fafcb5918f9e908cc0b4edb5640e02a454a009bc9e2a223140c69a0034087628c50014b40098ab10267ad032e2dbad3beceb40c5fb32d5695369a008f146da448869ca99a064cb19a465a631154b1a996d5fd290127d964f4a5fb349e9400d2ac3ad3a2539a066fe8970b6d27cf5d54132ce9b93a5494b711fad62eb3d291d33f84c1b84c8cd55c551cc26dab96d67e60e6810975008318e6ab52014479a77954801978a45a6006998a0a27b46db3ad6adce64878a096518226ddd2b6e01e5c5408ccbc3ba435025031b7078a483a5032c6696810ca746d86a065b5f985304186cd021ee70b5957072d40156595c0aabe6313d69944d0fdeae8ad3ee0a92e259350cbd283630f51eb598d4cc2644d511a664369c2988d6d39866a7bf61b291661bfdfad3b17c0a010ebc7c8acdfe2a045014eaa33006a6534c63f7" +
"535a90c4a5a042668cd002647a5191e94085522a64902f4140138bb3e94a2ecfa5030377ed5199031e6800dc29548a403b0be94e5d94c64e36531b6fa503162d8bce2ac8b951da908956e54ff0d48265f4a0761ac237e48a454507e51401a16968676f96ba8b383ecf085a45adc7b5675f5a1b8a83a64b429ff64134d3a166aae65ecd8cfec335652c360c0a5717b36473e9665a83fb128b8fd98e1a31f5a068c7d6907b31dfd8def49fd89ef45c3d9b0fec5a61d13de81fb3620d171deada593014ee2f66c952cea47b46228b8bd914df4b63de9aba51a43e46324d24d11e944501c849fd9868fece6a05c827f669a8db4e6a0394961b661d6a6fb39a62e42bcb6acd559b4e340f94864d3322ab1d2cd01ca3e3d3994d6ac11ec1414912d452f4a46861ea3f7ab3596998cc8dd2abbd5990ca2811224ec9d29ef74cdd6811599a9d1dc14a0090dd16eb5133d0041b69d542002a4514843e9b414368a042d21a042518a007629c2818fa4a005a75020c5488b414498a54148649498a603b14bb690c95054ab40c929eb401a36177f6635b96f76675cd4970dcb4b4ec549d4380a5a0631851b290085293650317652eca0066296801b4da004a2801e29d408434828011c53545021d4da0421a635301ab526da421a56a3614c442e2a1c5002d25002545274a00c4d43ad50a663311b154a51cd5232102669acb4c447450210d47" +
"4085a46a065efb1bfa527d8e4f4aa187d864feed3bec727f74d21584fb249fdd349f6493fbb4009f6493fba697ec927f7698ac3becafe9486d5ffbb4804fb2bff76816afe9405877d95ffbb4e16b27f74d30b0ff00b249fdda3ec927f74d218bf6493fba697ec927f76810ab68ff00dda985a3ff00768285fb249fdd34f4b493fbb400f368ff00dda6ada49fdda0097ecad8fbb4a2d5bfbb40c7fd99fd297eceff00dda403c40fe94f16ede9400ff25bd2b774b5222152cd69ee690a70a93a875140828a430a281851400ca522801b8a691400da2801c29d40843450035a9a2810b4940094c6a04247535021a6a36a00af25434c05c537140869a8dfa502317514e6a87966999483cb355a68cd333044e3a53190d0221294ddb4c4215a8f69a042ed3e948ca6811d808c53c42be95458ff002853bc95f4a041e42fa52f90be9400be42fa52f90be9400ef217d28fb3a7a5001f664feed3bece9e940c5fb327a53fece9e940870b64f4a77d9d3d28017ece9fdda77d9d3fbb48078b64feed3c5b27f76801df668ffbb4f16d1ff745003becb1ff0074528b48ff00ba2801ff00648ffba2945a47fdda0077d922fee8a5fb2c3fdc14861f658bfb8297ecd17f705001f668bfb829ea8abd052290ea2917ccc28a039828a039c28a43e70a280e7614501cec28a039d898146d14073862969073898a30281f3885052796280e71760a" +
"4f2c501ce279429a61a039c6ac5cd49e5d01cc063a63454c3988248aa1f2681730ef269a62a07cc30c551b4340b98af259abf5a67f672504dc4fecf4a824d3233da810d5d313d283a527a50044da525467494f4a0430e949519d2928187f65a535b4b4a622e44f9ab01856a48f0d4edc2810bb853b22900b9a75003a8a005a7500385385003a96801d4fa0070a78a007d385003b34e14807d2d030a2900514005140c28a40145030a28105148028a430a466da32698883ed89e86a64759172b400ea290c28a004dc01c52d0014500145001484d0044b302d8a9770a008a69b60cd54fb78a6048265916933400ea613486569a7d955fed82988789c1a915f3400b9a85985000a69f40119a8cd0031aab4b2e29810adc73536e0681199e66da68924635a08b0272a2a33348dd280268e56c735389a811344c4d58a402d2d031696980e14fa421d4b400ea70a0078a70a007d2d031d4f1480753a801d4b4005148028a06145200a2818514005148414521854573fea8d310a88be58e05456bf2b381d2800fb58dfb714e9ae44740041722538e869d34e22a40535b8f36e055ef306fdb40034a15b69a64b7023a0064576b21c5366bbd86980b0dc8945437175b29015ed65f324cd686681956f1be4aa711468f9a621626da4e3a54c936681922c99a71a00a1754d088450035d71d29165dab40082e6a09e5e6801e93f1522dcd002" +
"3cd8a15f75301b25537e4d210cf28534b6ca06545e6a75c0ad4919d4d4cb8a421e3151e7e7c50334601f2d58a042d2d002d2d318ea75210a29d400e14ea007d3a900ea75002d3c5003b34a0d031f4b48028a0028a0028a430a2800a2800a2a4028a002a0bcff00534c08638e7dbf7b8ab3147e5ad00456a83e63ef507dfbdc1ed408927012e148a41fbcb9e681848816e862827fd2a9005c9fdfad47f7ee306802c342bd475ace693131e2801623fbcc8a7200ee734c02150b31c55ea4054bee633598b6ec5720d004b6c71956a619364b8a605b80f7a9f348650bbe6a2589bd6980afc0a85bee500451c83a1a74b401149c5206a43261cd58514c4365e954da81113b15a84be68187924537c97cd68492f95b455760dbb8a00b702fcb4ab1fcf4017e3e0549400b4ea005a5a403a96988753a80169d400ea7d218b4fa005a78a005cd28a0078a766801d4b48028a0028a430a2800a29005140051400543743294012afdd14b48082d8601aa971986eb7f634c070633cc0d136e867dfda801a2432dc0a75c663983520222e649c52ca1a398376a007f9aced55ce6398e471401247f31e95012d14a6801f6e4993357681956f33b2a845395183408922196cd41729fbc06819720e16a534014aeb22a359e980ae770a88e5528020c6ea560452018f9a727340c942d4c2810d7e959f386078aa022059a90c669016378a78615a9" +
"235cd418c9a40585f9453a3a045a0e29dbc5002ee14edc2801770a76e140c5dc29dbe801770a706140876ea50d48076ea706a603b753b70a403b70a706a063b70a76ea00706a76ea0076fa5df4841b852ee140c334b48028a0028a40145030a2800a2800a2900948c15bad000a8abd28650dd6801a2341d052baabf5a006f9683b50c15bad0020451d29acaa7ad218815474a8dd15ba8a0068551d29d9a6031b06a03127a500236147154c9dd25022daf14b9a0646d835118d68013028e28191ec5a085a621bb4526d02801dc5191480616a89b069888b62e683b6981004a784ab10fd94be5d002f974f11d310a12976520176d382d002eda5da68017069769a00500d3b0690c760d38034c05c1a78cd210bf3528dd4c07734e1ba900ef9a9c33400f19a5e6818bcd2f34805e68f9a801d96a764d20005a972d400996a765a800cb5196a403496a32d400b96a32d40c4c9a32d484264d1934c62e4d265a900b9349934001269b934009934dc9a06264d3726801b9a6e4d0037269bcd0030e6a3db400bcd273400d39a69cd0319cd2734084e6939a60379a4e6801290d0030e69873400de6a36cd005517c29e2f456a4920be5a77db56900efb6ad3beda940870bd5a70bc4f5a602fdad29c2ed6900efb5a52fdad3d68017ed694bf6a4f5a0077da93d69c2e93d6801df6a4f5a70b94f5a0077da53d69ff00684f5a402fda13d6" +
"9c2e53d68013ed0b9eb522ce9eb400f1709eb4efb427ad003bed09eb4a274a403bcf5a5f3d28017cf4a5f3d3d68017cf4a5f3d3d6900be7ad1e7a5318be7252f9cb4842f9c9479cb40c3ce4a4f39290079cb48665a003ce4a3ce4a003cd5a4f356800f3568f39690c3ce5a4f396801be72d279cb4009e72d37ce5a006f9cb4d332d0037ce5a6f9cb4009e72d34ccb400c332d37cf5a06279eb49e72d0037ce5a69996801be72d279cb4009e7ad34ceb400df3d693cf5a60279eb49e7ad0030ceb519b85a0430dc2d31ae568030b34a09ad491f934edc69006ea5dc6818edc69c18d002ee34bbcd201779a371a005de69dbcd002ef6a5ded40c5f31bd69c1dbd6801de6b7ad2f9ad408779adeb4be737ad001e6b5384cdeb400ff0039bd6944cfeb4087899bd69de73fad031de73fad1e6b7ad21079afeb4be73fad03013bfad3fce7f5a00779cfeb4be737ad002899fd69de73fad001e7bfad2f9efeb480699dfd6944efeb4085f3dbd68f3dbd68189e7b7ad1f687f5a005f3dbd68fb437ad001e7b7ad1e7b7ad200f3dbd693ce6f5a006f9cd479cdeb400df39bd68f39bd6818df35a93ce6a00679ad49e69a4037cd6a4329a0630ca7d69be71a004f38d279cd40c6f9c69be7350037ce6a3ce34c04f34d34ca69009e61a3cd34c00c869be61a4034c86985cd3111ef34c6734c44229c2ac91d4ee2800a75003e9714805a314" +
"0c5c52e2818ec518a402e29db69806296801714b4805db4a1698876da70148050b4e02980ea75201d4b400b49400a296801d4ea402d385002d2520128a601494005148028a005a7520128c5301b494804a4a06252503194d3486253680186998a602629b40094d34806d140c29a68012969886d21a621b4d3400c34c6a649577d3b7d5922efa914f76a005f347a5384a2818ef328f3681079b479b400be6d3bcda061e6d2f9b480789a97cea4317cea779a2980be68a779a2810ef36944d40c70985384c2801c2514ef345003bcd14be68a005f34502514805330a4128a007f9a28f345003bce14be72d00289853bce14803cd1479a28013751e60a402f9ab479cb4009e72d1e72d002f9c297cc14083cc14be68a003cd14be68a0646651479c29011b4cb49e7afad031bf68149e78a00699c537cf140c6f9c29867a9010cd49e70a631be70a619850037cea6996985c6f9d479b45841e7530cb4c2e279b479b458421969a64a61713cca6f99408699298d255088714ec5310a3834a79a00314edb4c070a76290098a5c5002e28c5002e28a062d2d200a5a005a70a007d25031696900e14f14c629a4a403852d0014b4c05a290829690c70a77340829e29012ad47253022a664d00379a3268192264d4e169123b6d2628013068c5301a41a89b348644f9a61cd2189cd264d031b9a280139a4e68013349cd0034d379a620e690" +
"d301b4b480434d39a041b4d18a6025262801b494c436a37a00b1b71455006da784a0438253b6d05098e6a5f2e81079547954862f9547954c03cba3cba0426ca5d94862eca5f2e800d94e094087eca6eca062eca50b48638253c2500215a3650038252eda00365382d002eca365001b29db280176d2eda042eda315231e29766ea6027914dfb3d001f67a3ecf4844d1c15288a988779547934804f2693c9a062f9351b5bd0044d6d517d9a90c6fd9e93ecf48637ecd47d9a8189f66a4fb350027d9e93ecf400dfb351f66a003ecd486da801bf65a3ecf4c03ecf4bf66a401f67a4f23d6818c6b7c533c8a648c30534c34c0430d46d0d048da70ad04382d3f148028a6317bd58514863f14b8a062eda4c50018a4a421b8a762980b8a314805db4a05003f146da005d94bb29806da762900b8a31400a05382d002eda76da042eda365218bb69714006da5db4c41b68c5218629f1d2026a4a621b4b40122d3e900ea280128a40149400d61509140c6e293140c4c51b680131498a4026da4db4c61b6936d001b6936d0026da4d940098a4a0078c77a6b203d2802261511a40308a69a6030d44d408ad4f15b103a8a40145004f1459e4d4f8a450b4a0503169280128c5021a681480752d318ea5a043c52d002e29680168a4018a762801c053f14006296801d462900b8a314c0314b8a402eda42b400d2b4f8d69012518a621945201c" +
"0d381a621dba8cd218b9a4a00334668189519a005c537148618a4a004a3140098a3140c31462800db498a004c518a0085e994009499a0042deb51b500454c3400c351bd3110515a102d2d004a883bd4cbb28287ef146fa403b7d3f340c2933400b9a4a403696988752d201696801c296818b4b4c42d2d20141a750014b9a0078a75002d14805a280169d40052520108a7253024a2802334869084a33400b9a375002eea375001ba9375001ba8a431d4503129314005140c4a290051400525301b4940114a2a2a420a6d318c34c3400c3519a0432a37a6220c53b15a9225252017269d9a00326941340c76f229de61a403bcd6a4f34d00279e697cf3400be752f9d400ef3e9de7521dc3cda779b4c0709697cda430f36944a2810be68a5f32818e127bd384a2810be60a3cc1400f59053fcca0076fa5df400bba97750001a9dba900bba937500216a7a35004b9a4cd00309a693400dcd25021297348033466800cd19a4019a50681920a75030a281851400da2800a5a004c521a006d32801a79a81862801b9c5319a818d2d519348430d36a8069a8d8531322a5ab2036d1b680176d2eda402eda705a061b28d94006da61140098a3140831462900b45318b4b934805dd4bba980bbe8df400edf479948076fa5de2818be60a5de2801438a77982800f3052f99ef4807799ef4bbcd002eff7a5f34fad0317cd3eb479a7d6801ad3" +
"1f5a92198d2113f9a697cd34c0432526fa0037d2eea4026fa5df4006fa4df400bbe8df480378a5f305002f9829de68a061e68a5f345001e68a3cd14861e60a4f345300f3451e68a003cd14df3450034ca299e68a006194534cb400c320a88b03400d34d3480653735421b494010d2d684853a801696980b4b4805a5a4007a54669811b49838a7d002d14805a290052d0018a5a0031462801714628017146da062e28db4805db49b6980629280179a5f9e90c3e6a5c9a043852ed340c8df352419a422cd140c33450019a371a00334b9a0419a375030cd26ea402eea4cd2186ea5dd4c03751ba9006ea3750026ea375001ba9375300cd26ea004cd373400d26909a40309a6934c426ea5a0061a69a006525508fffd900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
saveToImgFile(str.toUpperCase(),"D://1.jpg");
}
图片转16进制
public static void main(String[] args) throws Exception {
try{
StringBuffer sb = new StringBuffer();
FileInputStream fis = new FileInputStream("D://1.jpg");
BufferedInputStream bis = new BufferedInputStream(fis);
java.io.ByteArrayOutputStream bos=new java.io.ByteArrayOutputStream();
byte[] buff=new byte[1024];
int len=0;
while((len=fis.read(buff))!=-1){
bos.write(buff,0,len);
}
//得到图片的字节数组
byte[] result=bos.toByteArray();
System.out.println("++++"+byte2HexStr(result));
//字节数组转成十六进制
//String str=byte2HexStr(result);
/*
* 将十六进制串保存到txt文件中
*/
//PrintWriter pw = new PrintWriter(new FileWriter("D://1.txt"));
//pw.println(str);
//pw.close();
}catch(IOException e){
}
}
/*
* 实现字节数组向十六进制的转换方法一
*/
public static String byte2HexStr(byte[] b) {
String hs="";
String stmp="";
for (int n=0;n<b.length;n++) {
stmp=(Integer.toHexString(b[n] & 0XFF));
if (stmp.length()==1) hs=hs+"0"+stmp;
else hs=hs+stmp;
}
return hs.toUpperCase();
}
private static byte uniteBytes(String src0, String src1) {
byte b0 = Byte.decode("0x" + src0).byteValue();
b0 = (byte) (b0 << 4);
byte b1 = Byte.decode("0x" + src1).byteValue();
byte ret = (byte) (b0 | b1);
return ret;
}
/*
*实现字节数组向十六进制的转换的方法二
*/
public static String bytesToHexString(byte[] src){
StringBuilder stringBuilder = new StringBuilder("");
if (src == null || src.length <= 0) {
return null;
}
for (int i = 0; i < src.length; i++) {
int v = src[i] & 0xFF;
String hv = Integer.toHexString(v);
if (hv.length() < 2) {
stringBuilder.append(0);
}
stringBuilder.append(hv);
}
return stringBuilder.toString();
}