bytearray

How to load a png image received through http post to OpenCV IplImage format.

I am writing a webserver which receives an image and do some processing and replys with results. The image is in the png format. It is received as a byte[] via POST using PHP. I have to convert this byte[] to OpenCV IplImage format. What are the steps I should follow to get this done? The way I am currently doing it is reading the imag...

Converting a byte array to string without using new operator in Java

Hi All, Is there a way to convert a byte array to string other than using new String(bytearray)? The exact problem is I transmit a json-formatted string over the network through UDP connection. At the other end, I receive it in a fixed-size byte array(as I am not aware of the array size) and create a new string out of the byte array. I...

How to turn a hex string into an unsigned char array?

For example, I have a cstring "E8 48 D8 FF FF 8B 0D" (including spaces) which needs to be converted into the equivalent unsigned char array {0xE8,0x48,0xD8,0xFF,0xFF,0x8B,0x0D}. What's an efficient way to do this? Thanks! EDIT: I can't used the std library... so consider this a C question. I'm sorry! ...

Saving several images (and metadata for each) in a single file using Adobe Air

Is it possible, via Adobe Air, to save multiple types of data in a single file? For example, an application would allow the user to load in external images, position them on stage and label them. This data would be then be stored in a ByteArray (I guess) using BitmapData for the images and probably XML for the metadata. I would then lik...

C++ Reading signed 32-bit integer value

Hi everyone, I have a multi-byte primitive type called s32 which I want to read from a byte array. The specifications are: It is a 32-bit signed integer value, stored in little-endian order. Negative integers are represented using 2's complement. It uses 1 to 5 bytes depending on the magnitude. Each byte contributes its low seven ...

AS3 Loading a MP3 into a ByteArray and then into a Sound?

Hi guys, I was wondering if there are any good workarounds to load a MP3 file into a Flash app but not via the Sound class but as a ByteArray via URLLoader and then give it to the Sound class play playback/etc.? I know about this workaround http://www.flexiblefactory.co.uk/flexible/?p=46#more-46 ... basically wrapping the loaded MP3 dat...

How to send float over serial

Whats the best way to send float, double, int16 over serial on Arduino? The Serial.print() only sends values only ascii encoded. But I want to send the values as bytes. Serial.write() accepts byte and bytearrays, but whats the best way to convert the values to bytes? I tried to cast an int16 to an byte*, without luck. I also used memcpy,...

How to pass a byte array readonly?

Think of the following code: static int Main() { byte[] data = File.ReadAllBytes("anyfile"); SomeMethod(data); ... } static void SomeMethod(byte[] data) { data[0] = anybytevalue; // this line should not be possible!!! byte b = data[0]; // only reading should be allowed ... } Is there a way of readon...

Python Create Byte Array for Web Service Expecting Byte[]

I'm using a SOAP based web service that expects an image element in the form of a 'ByteArray' described in their docs as being of type 'byte[]' - the client I am using is the Python based suds library. Problem is that I am not exactly sure how to represent the ByteArray in for this service - I presume that it should look something like ...

How to convert an int[,] to byte[] in C#

List item How to convert an int[,] to byte[] in C#? Some code will be appreciated EDIT: I need a function to perform the following: byte[] FuncName (int[,] Input) ...

Converting a byte array to an array of primitive types with unknown type in C#

Hello, I have the following problem. I have an array of bytes that I want to convert intro an array of primitive types. But I don't know the type. (This is given as an array of types). As a result I need an array of objects. Of course I could use a switch on the types (there are only a limited number of them), but I wonder if there is ...

Is there an equivalent to memcpy() in Java?

I have a byte[] and would like to copy it into another byte[]. Maybe I am showing my simple 'C' background here, but is there an equivalent to memcpy() on byte arrays in Java? ...

byte[] to BitmapImage in silverlight

Hello, For the purpose of a game, I need to serialize some pictures in a binary file through a WPF application, using bitmapEncoder and its child classes. But these class are not available in silverlight, so I can't load them into the browser from the same binary file. Does someone know how to convert a byte[] to BitmapImage in silver...

SqlBulkCopy with Byte[] DataTable column error

Hello, I have a strongly typed dataset containing a datatable with one of the columns as a byte[] column that I'm trying to insert into a binary(4) database table field. I'm able to set the byte[] column values without any problems, but I receive the following exception when I run sqlbulkcopy on the datatable: "The given value of type ...

pass value from and to servlet using HttpMessage

Hello all, I'm trying to send byte[] to a servlet and get the result back using O'Reilly HttpMessage. But I get a null pointer exception on retrieving. This is the code on the client app: URL url = null; try { url = new URL("http://localhost:8080/ImageFilter/imagefilter"); } catch (MalformedURLException e) { e.printStackTra...

Possible encoding type to convert a byte array to be sent by SMS

I need to send a public key created by RSA by SMS to another phone. I am converting the 148 byte public key to base64 to be sent by SMS. But it increases the 148 bytes to 200 bytes when converted. As byte[] cannot be directly sent by SMS, what are the other possible methods of converting them successfully to strings or equivalent which ...

Java Load image from URLConnection

Hello. I have a URLConnection, that access a web page. URL url = new URL("https://domain"); con = url.openConnection(); con.setDoOutput(true); Then i sent some data to the server using con.setRequestProperty() I get the response cookies fro ma specified field using String headerValue = con.getHeaderField(6); I also get the...

How pyamf.amf3.ByteArray save to ImageField?

I'm getting object 'pyamf.amf3.ByteArray' How can I save it to ImageField ? ...

JAVA - Creating X509 certificate from byte array

Hi, my server application send a certificate (by an array of byte) to the client who have to recreate the original certificate using the byte[] array. How can i do this? If i use the certificateFactory i can only pass by parameter an InputStream, which is not what i need. Anybody can help me? Thank you in advance ...

OutOfMemoryException using BZip2 (SharpZipLib)

I use Asp.net , .net 3.5, win2003, iis 6.0. I use Oracle for gathering files, saving file in SharpZipLib.BZip2 compressed format in field RAW in table Oracle. My application is Web, and I use WCF Service for get data (array of bytes) of a file. The aspx page send file to user (download file). My issue-problem: I read DATA from Orac...