bytearray

BlackBerry - Convert EncodedImage to byte []

I am using below code where i don't want to use JPEGEncodedImage.encode because it increases the size. So I need to directly convert from EncodedImage to byte array. FileConnection fc= (FileConnection)Connector.open(name); is=fc.openInputStream(); byte[] ReimgData = IOUtilities.streamToBytes(is); EncodedImage encode_image = Enco...

CIL and JVM Little endian to big endian in c# and java

Hello, I am using on the client C# where I am converting double values to byte array. I am using java on the server and I am using writeDouble and readDouble to convert double values to byte arrays. The problem is the double values from java at the end are not the double values at the begin giving to c# writeDouble in Java Converts...

In Adobe Air, how do I pull an image from a sqlite database that was created with .net?

We have the need to create a sqlite database that contains images. The database is created using .net. After the db is created we need to use an air application to pull the images from the sqlite db created with c#. The database is created fine and Air can read all but the BLOB field which contains a bytearray created from an image in .n...

How should I handle searching through byte arrays in Java?

Preliminary: I am writting my own httpclient in Java. I am trying to parse out the contents of chunked encoding. Here is my dilema: Since I am trying to parse out chunked http transfer encoding with a gzip payload there is a mix of ascii and binary. I can't just take the http resp content and convert it to a string and make use of Strin...

Conversion of byte[] into a String and then back to a byte[]

I am working on a proxy server. I am getting data in byte[] which I convert into a String to perform certain operations. Now when i convert this new String back into a byte[] it causes unknown problems. So mainly its like I need to know how to correctly convert abyte[] into a String and then back into a byte[] again. I tried to just co...

An easy way to replace fread()'s with reading from a byte array?

I have a piece of code that needs to be run from a restricted environment that doesn't allow stdio (Flash's Alchemy compiler). The code uses standard fopen/fread functions and I need to convert it to read from a char* array. Any ideas on how to best approach this? Does a wrapper exist or some library that would help? Thanks! EDIT: I...

how to convert byte array to key format??

hi everyone, i would like to know how to convert byte array into key. i am doing an AES encryption/decryption. instead of generating a key, i would like to use my generated byte array. byte[] clientCK = Milenage.f3(sharedSecret16, RANDbytes, opc); let say i have a byte array called clientCK, stated above. i want to use it in AES...

How do I compare between ByteString and ByteSymbol in squeak?

Hi, I want to execute the following code: methodName := thisContext sender method selector. aClass selectors do: [:current | current == methodName ifTrue: aBlock]. Although the strings are equal, it never steps into the "ifTrue", I've tried converting both of them to ByteArray\String and it steel didn't work. Any ideas of how to comp...

OutOfMemoryException when I read FileStream 500 MB

Hi all, I'm using Filestream for read big file (> 500 MB) and I get the OutOfMemoryException. Any solutions about it. My Code is: using (var fs3 = new FileStream(filePath2, FileMode.Open, FileAccess.Read)) { byte[] b2 = ReadFully(fs3, 1024); } public static byte[] ReadFully(Stre...

System.Drawing.Image as source for asp.net image container

I created image from byte array System.Drawing.Image newImage; using (MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length)) { ms.Write(imageBytes, 0, imageBytes.Length); newImage = System.Drawing.Image.FromStream(ms, true); } and now I need to have this image as a source for asp:Image (Sys...

C++ bit shifting

Hi, I am new to working with bits & bytes in C++ and I'm looking at some previously developed code and I need some help in understanding what is going on with the code. There is a byte array and populating it with some data and I noticed that the data was being '&' with a 0x0F (Please see code snipped below). I don't really understand ...

How to get a byte array from a drawable ressource ?

Hi all, I would like to get a byte array from an jpeg image located in my res/drawable file ? Does anyone know how to do that please ? ...

[Flex] Caching canvas into ByteArray

Task: (all in code, not visual) create a canvas, place into it some labels and draw some lines, then cache it as byteArray. The problem is that if I cache an object that is already drawed on the screen, it works great, but if I cache a canvas, that have been created few lines earlier, this results white image. Is there any solution to...

Time Stamp and byte array

Hi, I'm trying to insert a timestamp (hour:min:sec) into a two-byte array and i'm a little confused on how to accomplish this...any help is greatly appreciated! int Hour = CTime::GetCurrentTime().GetHour(); int Minute = CTime::GetCurrentTime().GetMinute(); int Second = CTime::GetCurrentTime().GetSecond(); BYTE arry[2]; //Need ...

Passing an ActionScript JPG Byte Array to Javscript (and eventually to PHP)

Our web application has a feature which uses Flash (AS3) to take photos using the user's web cam, then passes the resulting byte array to PHP where it is reconstructed and saved on the server. However, we need to be able to take this web application offline, and we have chosen Gears to do so. The user takes the app offline, performs his...

ArgumentOutOfRangeException when reading bytes from stream

I'm trying to read the response stream from an HttpWebResponse object. I know the length of the stream (_response.ContentLength) however I keep getting the following exception: Specified argument was out of the range of valid values. Parameter name: size While debugging, I noticed that at the time of the error, the values were as suc...

list(of byte) to Picturebox

I have a jpeg file that is being held as a list(of Byte) Currently I have code that I can use to load and save the jpeg file as either a binary (.jpeg) or a csv of bytes (asadsda.csv). I would like to be able to take the list(of Byte) and convert it directly to a Picturebox without saving it to disk and then loading it to the picturebox...

Representing a number in a byte array (java programming)

I'm trying to represent the port number 9876 (or 0x2694 in hex) in a two byte array: class foo { public static void main (String args[]) { byte[] sendData = new byte[1]; sendData[0] = 0x26; sendData[1] = 0x94; } } But I get a warning about possible loss of precision: foo.java:5: possible loss of precision found ...

AS3 and the loader class

Hi, I write here, because after looking for a solution, I could not resolve my error... var test:MovieClip; var sign:Loader = new Loader(); sign.contentLoaderInfo.addEventListener(Event.COMPLETE, completSIGN); sign.load(new URLRequest("http://files.zebest-3000.com/278374/3011/3011.swf")); function completSIGN(e:Event):void { ...

How do I post a .wav file from CS5 Flash, AS3 to a Java servlet?

Hi, I am trying to send a byteArray from my .fla to my running tomcat server integrated in Eclipse. From flash I am using the following code: var loader:URLLoader = new URLLoader(); var header:URLRequestHeader = new URLRequestHeader("audio/wav", "application/octet-stream"); var request:URLRequest = new URLRequest("http://localhost:808...