Questions tagged [byte]

A unit of information usually corresponding to 8 bits. This term is also most often used to indicate the smallest addressable unit of storage on a digital system.

A unit of information usually corresponding to 8 bits. This term is also most often used to indicate the smallest addressable unit of storage on a digital system.

These days, the term byte usually refers to a unit of information consisting of 8 . Historically, other sizes have been used as well. If one wants to stress the fixed size, the term octet can be used instead.

7028 questions
2
votes
1 answer

Visualizer onFftDataCapture - Does the byte[] index represent frequency?

I'm having understanding the Android Visualizer's onFftDataCapture((Visualizer visualizer, byte[] fft, int samplingRate) How do I know which frequency is represented by which byte in fft? For example, would the index be a…
Dan
  • 278
  • 1
  • 3
  • 14
2
votes
2 answers

Problem Inflating byte[] in Java?

I ran into an issue which I can't figure out. Here is the definition of the problem: I have some data in a Blob column in Db2/Linux environment. Blob was written into DB2 after the byte[] was compressed using JDK compression (code that does this is…
John
  • 817
  • 3
  • 10
  • 19
2
votes
3 answers

Swap bytes within an unsigned long (8 bytes) in C

unsigned long swap_bytes(unsigned long n) { unsigned char bytes[8]; unsigned long temp; bytes[0] = (n >> ??) & 0xff; bytes[1] = (n >> ??) & 0xff; // ... } I am really confused on how to shift an 8 byte unsigned long from ex:…
dp123
  • 21
  • 4
2
votes
2 answers

C Pointer Mangement (Address, Dereferencing, Reassigning)

I'm trying to write a function that will access a byte and change it for another. I'm having trouble managing the pointers. Can someone help me fix this code so that px points to the address, and i can then increment pc (which is the same as px but…
Ozzoned
  • 35
  • 6
2
votes
1 answer

How to handle byte stream without corrupting data

I got a problem of how to handle byte data without corrupting them. Here is my code ... byte[] b = new byte[1000]; // read input stream BufferedInputStream inData = new BufferedInputStream(socket.getInputStream()); int length =…
Kaninchen
  • 431
  • 2
  • 5
  • 16
2
votes
1 answer

Converting from bytes to GB or MB returns nothing

I got this code, which returns number of bytes: $size = Get-ChildItem $userAccount.homeDirectory -Recurse | Measure-Object -Property Length -Sum This works fine, but is not very user friendly, so I want to convert to megabytes or gigabytes. After…
Erik M.
  • 61
  • 7
2
votes
1 answer

Javascript, convert array of numbers into double

I need to convert an array of 8 bytes into a double. This is my starting array: [170, 85, 255, 63, 205, 171, 170, 85] and it should convert to -9.591053231630682E-105. Each element of the array can be from 0 to 256.
Chuender
  • 35
  • 6
2
votes
1 answer

Filling a USB with 0 bytes

I'm writing a program that will fill a USB drive with 0 bytes in order to turn it into a bootable disk (that part is coming later). Right now what I have is this: import io import lib class CancelBlockCipherException(Exception): pass class…
mawi
  • 83
  • 4
2
votes
1 answer

How to convert a byte to ASCII hexadecimal representation in c++?

I just want to convert a byte to its ASCII character. Here is the problem: Lets suppose we have a character like below: char a = 0x0b; I just want to convert this to its hexadecimal ASCII character representation 'b' .
2
votes
3 answers

Why is the serialized size of my class larger, then the sum of its variables

I have a simple Java class: import java.io.Serializable; public class SimpleClass implements Serializable { private static final long serialVersionUID = -9062339996046009959L; public byte Byte; public int id; public…
user5644457
2
votes
1 answer

Why reading and array of bytes at a time is faster than reading one byte?

"Reading an array of bytes at a time is much faster than reading one byte at a time"I saw the sentence there while i was trying to learn for input stream. Why this is the case?
Ziya ERKOC
  • 811
  • 6
  • 15
2
votes
7 answers

Is it possible to see if two MP3 files are the same song by analyzing the files' bytes?

This is to be done in C++ or C.... I know we can read the MP3s' meta data, but that information can be changed by anyone, can't it? So is there a way to analyze a file's contents and compare it against another file and determine if it is in fact the…
zcourts
  • 4,213
  • 4
  • 43
  • 68
2
votes
2 answers

Checksum Generation from sum of bits in python

I am trying to control a chiller through RS232 with python. I am stuck at generating a checksum as required by the following method. "The checksum is two ASCII hexadecimal bytes representing the least significant 8 bits of the sum of all preceding…
2
votes
1 answer

Read a row of a file starting at byte offset until new line

I am using os.ReadAt() to read certain rows in a csv/tsv file. However, I don't know how many bytes are in that row, I just need to read the line starting at the byte offset I specify until the newline. buffer = make([]byte, 46) os.ReadAt(buffer,…
Jason Piao
  • 67
  • 1
  • 6
2
votes
1 answer

python - Steganographer File Handling Error for non plain-text files

I've built a Python Steganographer and am trying to add a GUI to it. After my previous question regarding reading all kinds of files in Python. Since, the steganographer can only encode bytes in image. I want to add support to directly encode a file…
TheRandomGuy
  • 307
  • 5
  • 19