Most voted "byte" questions
A byte is one of the integral data types in computing. It is often used to specify the size or amount of the memory or storage capacity of a certain device, regardless of data type.
Learn more…33 questions
Sort by count of
-
20
votes4
answers6387
views -
11
votes5
answers1059
viewsIs it possible to convert a 16-bit number to a single byte?
If I create the following expression: Int16 numero = 2017; byte m = (byte) numero; m will have the value of 225. Okay, how do I get 2017 from the byte m (reverse operation) again?…
-
7
votes2
answers227
viewsHow to convert byte to Boolean[8] and convert back?
I need to record some booleans in a File, and then retrieve them. I can record and read one or more bytes with the Classes java.io.FileInputStream and java.io.FileOutputStream, so I need to convert…
-
6
votes2
answers4614
viewsCharacter size (ASCII vs other encodings) in bytes
Seeing this issue a doubt arose, coming from PHP and in the past having "problems" derived from character encoding, ex: srtpos vs mb_strpos, i knew that all ASCII characters have 1 byte, but I…
-
5
votes1
answer104
viewsHow to read, search and change file by bytes?
Does anyone know how to find more bytes after I found the byte sequence of my variable? for example: in the file will look like this: 6261725610 I’ll look for that: byte[] findBytes = { 0x62, 0x61,…
-
5
votes1
answer57
viewsPHP xf0 represents 0xF0?
If \xF0 represents a hexa as well as 0xF0, because their exit is different? echo "\xF0"; echo 0xF0; I can’t really find any information on that notation \xF0 in the PHP manual.…
-
4
votes4
answers1394
viewsHow to concatenate two byte arrays in Java?
I have: byte mensagem[]; byte nonce[]; How do I concatenate the array nonce at the end of the array mensagem and store in a third array?…
-
4
votes2
answers1591
viewsWhat happens when I convert String to an array of bytes?
I have: String msg = "Texto a ser encriptado"; byte array[] = msg.getBytes(); What happens when I convert the string to an array of bytes? I’m concerned about an application I’m developing. I need…
-
4
votes2
answers1153
viewsHow to transform integers into byte in 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 transform the values of the list into bytes to send, because…
-
3
votes3
answers225
viewsDoubt about showing local network IP
I am developing an application to turn off the PC’s of a laboratory. I have a reference to class InetAddress, invoking the method getLocalhost(). Then I throw it in a array byte and then I did a for…
-
2
votes2
answers2457
viewsSubtract dates and compare with value
I have two dates: DataAcesso and DataAtual of the kind DateTime. I have one more field called TempoAtualizacaoAutomatica typo byte. I need to subtract these dates and compare the result with…
-
2
votes1
answer721
viewsTransform int to python byte
Hello, Need to transform a value int to byte. I tried to do it this way: import serial ser = serial.Serial('/dev/ttyACM0', 9600) angulo = 90 ser.write(angulo) #while 1 : print ser.readline() I need…
-
2
votes1
answer347
viewsUsing "bytes" and "bits"
What use bytes and bits? I’m reading some C and C++ programming books that talk about bytes and I wanted to know what the use is or what these terms are for. For example, this table below talks…
-
1
votes1
answer889
viewsInsert values from an array of bytes into an int array without converting them
I have this vector int: int[] vetor = new int [dataRegCodeToCompare.length]; and that byte vector : (which receives the "Digest" of another byte array) byte[] dataRegCodeToCompare =…
-
1
votes1
answer801
viewsEncoding, bytes conversion - strings
I have a problem, I’ve been researching but all the solutions I find don’t work. The problem is that I am accessing a page (.txt) and cannot convert it from bytes for string, to be able to work the…
-
1
votes0
answers23
viewsGenerate byte image array to insert into BD
I need to save a jpg image in the database in a BLOB column, however, everything I tried didn’t work out, what I’m testing now to try to generate the byte array is this: ini_set('memory_limit',…
-
1
votes2
answers955
viewsHow to print the day numbers of each month using Array, String and byte?
I’m trying this code, but it doesn’t 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,…
-
1
votes1
answer289
viewsHow to enumerate the position of a bit within a byte?
Where to start placing an ordinal numbering on a given byte, I start counting the most significant (the left )or the least significant (the right)? For example for the decimal number 128 having the…
-
1
votes1
answer310
viewsExport Text field to Bytea in Postgresql
I could make an application to export the contents of a Text field to Bytea without problems, but since there are thousands of records I believe that if I do via SQL will be faster. If that is…
-
1
votes0
answers30
viewsNETBEANS - JAVA - DERBY - Error Retrieving Byte for Imageicon
All right, all right? I have stored a BLOB file and am looking to do recovery of it, is a JPG. Below is the Resultset of the same: byte[] bin = null; // (2) ResultSet rs; try { rs =…
-
0
votes2
answers773
viewsPHP / Codeigniter - How to convert image to byte array?
I want to record here 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)); }…
-
0
votes1
answer152
viewsUsing Unicode in a variable char
Guys like me to use unicode in C? I just don’t know how to store the 2 bytes of one unicode on a char, that’s all, someone knows how?
-
0
votes0
answers61
viewsHow to add bytes to a byte array?
Boas. How do I add one byte[] to another byte[]? Byte1.add(byte2); Giving more code will not help in understanding the problem. But I will explain better. I have a byte[] called fullbytecoll[] that…
-
0
votes1
answer505
viewsProblem Inserting Bytea in postgresql
I did this update to update a column in my company table, my column in the database is like bytea and I’m saving an image as byte[] ... in my company class, I have the variable Photo that is of the…
-
0
votes0
answers125
viewsSending byte[] socket data
I’ve had a problem for a few days that I can’t fix. I have a socket connection and I am testing signature on messages, I have an object Mensagem that contain String mensagem, String assinatura and…
-
0
votes1
answer228
viewsWhat is a byte array?
What is the byte array in Unity? I know we store data that can be converted into bytes.
-
0
votes1
answer72
viewsJava Server Application Client loops
I’m developing a system for school reinforcement simple functions. At the time I went to implement my class that makes the data encryption needed to change also the type of data that will traffic…
-
0
votes1
answer34
viewsError while getting Bytearray from.3gp file on Android/Java
I am trying to convert a file from audio.3gp for string Base64 and send to the server using Volley, but for all I know, I need to transform the audio.3gp in Bytearray and transform that array string…
-
0
votes1
answer31
viewsFileinfo.Length gives wrong size
I’m trying to add the thumbnail, the name and size of a file to a ListView. I can add everything correctly except the size! I’m making Split PDF and I will add the information of each page to the…
-
-1
votes2
answers750
viewsConvert a byte variable into a string?
Good afternoon liked to convert a byte variable into string. I have the following code; print(str.encode(frase)) which gives the following output; b'Ola' and wanted before; Ola I found a way to…
-
-1
votes1
answer39
views"Non-static method" error
Below is my part of the code that is giving this problem: "Non-static method' write(byte[], int,int)' cannot be refenced from a Static context". I don’t understand this error message! Could you help…
-
-1
votes1
answer448
viewsWhat is the difference between operating code (opcode) and instruction set (Instruction set)
What’s the difference between them? I know they both show commands that exist in each architecture.
-
-3
votes1
answer31
viewsHow to always take the next 2 elements of a string
I have the following string: gxAjaxKey = "FF00FFFFFFFF2426FFFFFF046448FF70" I must take 2 elements at a time from this string and convert to byte: FF = 255 00 = 0 FF = 255 . . . 70 = 112 I wrote the…