Find Jobs
Hire Freelancers

Bug in Java HashMap Code

$15-20 USD

Completed
Posted over 14 years ago

$15-20 USD

Paid on delivery
I have a bug in the following code.? It works the first time around but not the 2nd.? I think something is not? getting? cleared out.? I can send the entire package to the wining bidder. The finished product will be? to resolve the bug. ? static HashMap<Integer, Integer> reassembledIn = new HashMap<Integer, Integer>(); ? static HashMap<Integer, List<Integer>> reassemblyMap; ? static HashMap<Integer, byte[]> reassemblyFrameData = new HashMap<Integer, byte[]>(); if (reassemblyMap != null && [login to view URL](new Integer(FrameNum)) != null) { ? ? ? ? ? ? List<Integer> framesList = [login to view URL](new Integer(FrameNum)); ? ? ? ? ? ? int total = 0; ? ? ? ? ? ? Iterator<Integer> it = [login to view URL](); ? ? ? ? ? ? while ([login to view URL]()) { ? ? ? ? ? ? ? Integer frame = [login to view URL](); ? ? ? ? ? ? ? byte[] frameData = [login to view URL](frame); ? ? ? ? ? ? ? total += [login to view URL]; ? ? ? ? ? ? } ? ? ? ? ? ? PacketBuf = new byte[total]; ? ? ? ? ? ? it = [login to view URL](); ? ? ? ? ? ? int pos = 0; ? ? ? ? ? ? while ([login to view URL]()) { ? ? ? ? ? ? ? Integer frame = [login to view URL](); ? ? ? ? ? ? ? byte[] frameData = [login to view URL](frame); ? ? ? ? ? ? ? [login to view URL](frameData, 0, PacketBuf, pos, [login to view URL]); ? ? ? ? ? ? ? pos += [login to view URL]; ? ? ? ? ? ? } ? ? ? ? ? ? start_offs = 0; ? ? ? ? ? ? [login to view URL]("Reassembled Frames on Frame " + FrameNum + ": " + framesList).append([login to view URL]); ? ? ? ? ? ? ? ? ? ? ? ? [login to view URL]("Reassembled Frames on Frame " + FrameNum + ": " + framesList); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } else if (reassembledInFrame != null) { ? ? ? ? ? ? [login to view URL]("Frame ").append(FrameNum).append(" is reassembled in frame ").append(reassembledInFrame).append([login to view URL]); ? ? ? ? ? ? start_offs = [login to view URL]; ? ? ? ? ? ? break; ? ? ? ? ? } else if ([login to view URL] + startIpOffset == start_offs) { ? ? ? ? ? ? //the buffer has reached the end of the frame, the remaining data is the ethernet trailer ? ? ? ? ? ? start_offs = [login to view URL]; ? ? ? ? ? ? break; ? ? ? ? ? }
Project ID: 2980106

About the project

2 proposals
Remote project
Active 14 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$10 USD in 3 days
4.9 (272 reviews)
5.9
5.9
2 freelancers are bidding on average $12 USD for this job
User Avatar
See private message.
$14.45 USD in 3 days
5.0 (15 reviews)
3.5
3.5

About the client

Flag of UNITED STATES
Carmel Valley, United States
5.0
302
Payment method verified
Member since Jul 1, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.