Results 1 to 4 of 4
- 07-07-2011, 10:37 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 2
- Rep Power
- 0
Thoughts about how to bit shift large amounts of data
Hello!
I'm new to the forums
, so go easy, eh?
I'm trying to write an application that does the following:
- Recieve UDP Packet
- Sequence with remainder of previous packet
- Find start bits, read following 100 bytes
- Reformat these bytes from 12 bits -> 16 bits
- Rebroadcast 512 byte segments
Let me explain the situation further.
Each UDP packet comes in with 512 bytes of data. Somewhere in the data are some start bits (a 24 bit word). I need to find this word, and then read the 100 bytes following this word. The data contained within these 100 bytes are in 12 bit format, so I need to recondition the data such that there are 4 leading 0s on each piece (making the values 2 bytes a piece). I then need to rebroadcast this data.
Here are some of the issues:
Data will always be split between packets; including the synch word sometimes. I need to be able to double buffer the packets, and remove data away as this happens (I'm not so worried about being able to do this part)
What I AM having trouble with, is how to handle this data in a bit-wise fashion. While the synch word DOES fit nicely into 3 bytes, it's not guaranteed that it will fall spatially into 3 bytes (e.x. if the synch word was 000000000000000000000001, the word that i'm looking for COULD be 00 00 01, or (XXX0) 00 00 0 (001X), or (XX00) 00 00 0(01XX), etc. I would think that I need to start at the beginning, bitshift all of the data and read 24 bytes until I find my synch word.
I also need some help thinking about how to recondition those 12 bit values into two bytes.
I know its a lot! Thanks for any help that anyone can give.gif)
Jacob
- 07-07-2011, 11:06 PM #2
0123.4567 89AB.0123 4567.89AB => 0000.0123 4567.89AB 0000.0123 4567.89ABhow to recondition those 12 bit values into two bytes.
Every 3 bytes go to 4 bytes
How does that fit into 100 bytes? It's not a multiple of 3?Last edited by Norm; 07-07-2011 at 11:30 PM.
- 07-08-2011, 12:42 AM #3
Member
- Join Date
- Jul 2011
- Posts
- 2
- Rep Power
- 0
- 07-08-2011, 12:48 AM #4
Similar Threads
-
How to save large amounts of similar objects?
By nieuwenhuizen-jk in forum New To JavaReplies: 12Last Post: 05-13-2011, 03:21 PM -
Spliting Large String Data (upto 2 GB)
By piyush@java in forum Advanced JavaReplies: 5Last Post: 01-12-2011, 02:23 PM -
Large data over RMI
By JavaDesigner in forum New To JavaReplies: 7Last Post: 10-16-2009, 08:48 PM -
Need your thoughts on the best way to store/save/send a VERY large string
By 2potatocakes in forum Advanced JavaReplies: 6Last Post: 01-19-2009, 08:28 PM -
what's the fastest method of storing and retrieving large amounts of data in Java?
By 2potatocakes in forum New To JavaReplies: 1Last Post: 12-28-2008, 10:25 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks