Java Convert 4 bytes to int

Posted by ikurtz on Stack Overflow See other posts from Stack Overflow or by ikurtz
Published on 2010-05-15T13:03:27Z Indexed on 2010/05/15 13:14 UTC
Read the original article Hit count: 316

Filed under:
|
|

i was wondering if the solution for this documented here is still the solution or is there any other way getting an int from 4 bytes?

thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about packing

  • 2D packing with obstacles

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Anybody know of an efficient algorithm for moving rectangles in a square which contains obstacles? Rectangles: can rotate can move must not collide with obstacles (black squares) Obstacles: can't be moved can be added anywhere Goal: move rectangles until you can >>> More

  • C/C++ packing signed char into int

    as seen on Stack Overflow - Search for 'Stack Overflow'
    hello I have need to pack four signed bytes into 32-bit integral type. this is what I came up to: int byte(char c) { return (unsigned char)c; } int pack(char c0, char c1, ...) { return byte(c0) | byte(c1) << 8 | ...; } is this a good solution? Is it portable? is there a ready-made solution… >>> More

  • Packing a DBF

    as seen on Geeks with Blogs - Search for 'Geeks with Blogs'
    I thought my days of dealing with DBFs as a "production data" source were over, but HA (no such luck). I recently had to retrieve, modify and replace some data that needed to be delivered in a DBF file. Everything was fine until I realized / remembered the DBF driver does not ACTUALLY delete records… >>> More

  • Packing a DBF

    as seen on Geeks with Blogs - Search for 'Geeks with Blogs'
    I thought my days of dealing with DBFs as a "production data" source were over, but HA (no such luck). I recently had to retrieve, modify and replace some data that needed to be delivered in a DBF file. Everything was fine until I realized / remembered the DBF driver does not ACTUALLY delete records… >>> More

  • Bin packing part 6: Further improvements

    as seen on SQL Blog - Search for 'SQL Blog'
    In part 5 of my series on the bin packing problem, I presented a method that sits somewhere in between the true row-by-row iterative characteristics of the first three parts and the truly set-based approach of the fourth part. I did use iteration, but each pass through the loop would use a set-based… >>> More