Questions tagged as 'byte'

2
answers

How to transform byte integers into the Python language?

I'm using the pyserial module to send serial data, so I have a list of values like: Valores = [10,20,30,40,50,60,70,80,90,100] I need to convert the values of the list into bytes to be able to send, because if I try to send it like this:...
asked by 19.01.2018 / 18:50
2
answers

How to print the number of days of each month using Array, String and byte?

I'm trying this code, but it does not work. public class MesDias { public static void main(String[] args) { // Array String byte String Mes = {Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez}; byte[] Di...
asked by 04.01.2017 / 15:24
1
answer

Insert values from an array of bytes into an int array without converting them

I have this int vector: int[] vetor = new int [dataRegCodeToCompare.length]; and this vector byte: (which receives the digest of another byte array) byte[] dataRegCodeToCompare = md5.digest(toHash); I want to put the values of the byte...
asked by 22.04.2015 / 20:40
1
answer

How to enumerate the position of a bit within a byte?

Where to start putting an ordinal number in a given byte, do I start counting the most significant (left) or least significant (right)? For example for the decimal number 128 that has the binary representation: 1000 0000 If I want to ref...
asked by 12.06.2017 / 17:01
1
answer

Encoding, conversion bytes - strings

I have a problem, I've been searching but all the solutions I find do not work. The problem is that I am accessing a page (.txt) and I can not convert it from bytes to string , in order to work the data (ex: page.split("\n") ) import...
asked by 02.07.2015 / 12:41
0
answers

NETBEANS - JAVA - DERBY - Error retrieving byte for ImageIcon

Save everything good? I stored a BLOB file and I'm looking to recover it, it's a JPG. Below is the ResultSet of it: byte[] bin = null; // (2) ResultSet rs; try { rs = produtoCont...
asked by 27.11.2017 / 01:51
2
answers

PHP / Codeigniter - How to convert image to byte array? [closed]

I want to leave here registered my solution to this problem. $data = file_get_contents("/ImagePath/Image.jpg"); $array = array(); foreach(str_split($data) as $char){ array_push($array, ord($char)); }     
asked by 24.06.2015 / 16:35
1
answer

Using Unicode in a variable char

How do I use unicode in C ? I just do not know how to store the 2 bytes of a unicode in a char, only this, does anyone know how?     
asked by 28.10.2015 / 03:57
1
answer

Export Text field to Bytea in PostgreSQL

I could make an application to export the contents of a Text field to Bytea without problems, but as they are thousands of records I believe that if I do via SQL it will be faster. If this is possible of course. I have a table with a text...
asked by 27.06.2018 / 17:36
1
answer

Problem inserting Bytea in postgreSQL

I made this update to update a column in my company table, my column in the database is of type bytea and I am saving an image as a byte [] ... in my company class, I have the variable is of type Byte [] Foto public int Update(c...
asked by 12.09.2017 / 15:00