byte-shifting

Help with byte shifting

Hello, I need to byte-shift a text file. I know absolutely nothing about perl, but I found a perfectly working piece of code in perl called moz-byteshift.pl (documentation). This does exactly what I want to do, but I need to do it in C#. Here's the source code of the perl file: #!/usr/bin/perl # To perform a byteshift of 7 # To d...

convert 24bit RGB to ARGB16

hi, i am reading a 24bpp bitmap , and i need to convert each pixel from RGB24 to ARGB16. i am using this : #define ARGB16(a, r, g, b) ( ((a) << 15) | (r)|((g)<<5)|((b)<<10)) but the output it's not what i need, can someone offer some help ? thank you. ...

Creating a ISO-8859-1 string from a HEX-string in Java, shifting bits.

Hello experts! I am trying to convert a HEX-sequence to a String encoded in either, ISO-8859-1, UTF-8 or UTF-16BE. That is, I have a String looking like: "0422043504410442" this represents the characters: "Test" in UTF-16BE. The code I used to convert between the two formats was: private static String hex2String(String hex, String enc...