Все вопросы: [binary-data]
53 вопросов
Библиотеки Java для чтения метаданных из файлов .image, .osc и .mccd
Мне нужно прочитать метаданные из файлов .img, .osc и .mccd. Можете ли вы порекомендовать какие-либо библиотеки или дать какие-либо указания относительно того, как я буду это делать.В конце концов мне нужно поместить эти метаданные в XML-файл, чтобы их можно было собрать в репозитории.
Производительность в таблицах с двоичными данными / изображениями
Я сделал экран обслуживания людей.Клиент хочет, чтобы я сохранял фотографии каждого человека в базе данных, и я сделал это без проблем.У меня есть отдельная таблица для изображений с двумя полями: Id_person и Image. Я немного волнуюсь, потому что впервые работаю с изображениями в базе данных....
C #, запись двоичных данных
У меня проблема с записью в двоичный файл. //This is preparing the counter as binary int nCounterIn = ...; int nCounterTotalInNetwork = System.Net.IPAddress.HostToNetworkOrder(nCounterIn); byte[] byteFormat = BitConverter.GetBytes(nCounterTotalInNetwork); char[] charFormat = System.Text.ASCIIE...
Python binary data reading
A urllib2 request receives binary response as below: 00 00 00 01 00 04 41 4D 54 44 00 00 00 00 02 41 97 33 33 41 99 5C 29 41 90 3D 71 41 91 D7 0A 47 0F C6 14 00 00 01 16 6A E0 68 80 41 93 B4 05 41 97 1E B8 41 90 7A E1 41 96 8F 57 46 E6 2E 80 00 00 01 16 7A 53 7C 80 FF FF Its structure is: DATA, ...
Human-readable binary data using Python
My work requires that I perform a mathematical simulation whose parameters come from a binary file. The simulator can read such binary file without a problem. However, I need to peek inside the binary file to make sure the parameters are what I need them to be, and I cannot seem to be able to do...
vector <unsigned char> vs string for binary data</unsigned>
Which is a better c++ container for holding and accessing binary data? std::vector<unsigned char> or std::string Is one more efficient than the other? Is one a more 'correct' usage?
Is it safe to convert a mysqlpp::sql_blob to a std::string?
I'm grabbing some binary data out of my MySQL database. It comes out as a mysqlpp::sql_blob type. It just so happens that this BLOB is a serialized Google Protobuf. I need to de-serialize it so that I can access it normally. This gives a compile error, since ParseFromString() is not intended ...
Lamp / Cakephp: Streaming an image : Binary 0x00 replaced by 0x20
I'm trying to create a script that pulls an image out of the database and displays it to the user, called by <img src="viewImage/someImageName"> But the problem I'm having is when the image is displayed all of the Nulls (0x00) are replaced by 0x20 and I have no idea why. The data in the da...
Synchronizing Large Unversioned Files Within Subversion Checkout
We've been working with a Subversion repository for some time now for a research lab and have repeatedly been presented with a common issue: We want to version all of the code, and small bits of permanent data, but we also have large binary blobs that live within ignored directories in user chec...
Storing XML document in pre-parsed binary format
My application need to store large amounts of XML-like hierarchical information with the following requirements: Fast to read Minimal memory consumption Typed data instead of merely text Any suggestions for a binary format that fulfills these goals?
Reading/writing binary structures: how to simplify this code?
I'm writing a network app, which sends and receives a lot of different kinds of binary packets, and I'm trying to make adding new kinds of packets to my app as easy as possible. For now, I created a Packet class, and I create subclasses of it for each different kind of packet. However, it isn't ...
custom data iostream
I have a data structure defined as struct myDataStruct { int32_t header; int16_t data[8]; } and I want to take a character stream and turn it into a myData stream. What stream class should I extend? I would like to create a custom stream class so that I can do things like myDataStruct...
efficient and flexible binary data parsing
I have an external device that spits out UDP packets of binary data and software running on an embedded system that needs to read this data stream, parse it and do somethign useful. The binary data gets logged to a file as well. I would like to write a parser that can easily take the input dire...
Serializing a object with an image to be saved to SQL database
I have the following object: [Serializable] public class ExampleImage { public int ID { get; set; } public string Filename { get; set; } public byte[] Content { get; set; } } I store this in a List<ExampleImage> which I then pass to the following function to serialize it to a...
Returning binary content from a JPF action with Weblogic Portal 10.2
One of the actions of my JPF controller builds up a PDF file and I would like to return this file to the user so that he can download it. Is it possible to do that or am I forced to write the file somewhere and have my action forward a link to this file? Note that I would like to avoid that as m...
Read binary C float in Actionscript 3?
I have binary C/C++ data types (e.g. in memory version of a C float) which I need to read into Actionscript 3 and would prefer not to code this from scratch. Anyone know of any libraries, sample code, pseudo code to help with this? For example: C/C++ app: float f = 1.1; SaveFloatToFile(f, 'my...
determine if blob is an image without loading entire field?
is there a way to read only a few bytes out of a BLOB type field in a database (for this question it doesn't matter the DB brand) and determine if the binary content is an image (assume it is one of: JPG, GIF, PNG)? I have a webapp that stores files in the database, and if it is an image, I want...
ASP.NET Webservice corrupts uploaded file
I have a webservice through which I can upload documents to our ASP.NET web site. The problem is when I upload PDF & word documents, they get corrupted when I try to open them. Text documents always upload fine. What is even strange is that on my development machine, these files upload fine ...
Установка двоичных данных с помощью setblob в соединителе mysql / c ++ вызывает сбой
Я пытался использовать setBlob () следующим образом: class DataBuf : public streambuf { public: DataBuf(char * d, size_t s) { setg(d, d, d + s); } }; char b[20]; DataBuf buffer((char*)b, 20); istream stream(&buffer); PreparedStatement* s = con->PrepareStatement("insert ...
Запись целочисленных значений в двоичный файл
Допустим, у меня есть массив чисел, содержащий следующие значения: int numbers = [12, 511, 337, 254]; Теперь я хотел бы преобразовать эти числа в однобайтовые значения и сохранить их в массив символов char numbersscaled; for(i=0; i<4; i++) { numbersscaled[i] = numbers[i]/2;...
Поведение потоковых декодеров .NET
У меня есть процесс, который пытается декодировать различные кодировки строк из двоичного потока. Я получаю некоторое поведение, которое не совсем укладывается в моей голове, когда я прохожу через него. В частности, я делаю следующее: получить максимальное количество байтов, которое будет ис...
Какой язык для двоичного кода, как Perl для текста?
Я ищу язык сценариев (или программирования более высокого уровня) (или, например, модули для Python или подобных языков) для легкого анализа и управления двоичными данными в файлах (например, дампов ядра), подобно тому, как Perl позволяет очень плавно манипулировать текстовыми файлами . В чис...
Обратный инжиниринг файла статистических данных с моего контроллера инсулиновой помпы
Это может быть, а может и не быть темой серой зоны, хотя мои намерения, конечно, не таковы, поэтому я не намерен поднимать этические дебаты по теме обратного проектирования. Я диабетик 1 типа, в настоящее время получаю помповую терапию. Я пользователь OmniPod , это одноразовая капсула, котор...
Что является наиболее эффективным кодированием двоичного кода в текст?
Ближайшими соперниками, которых я смог найти, являются yEnc (2%) и ASCII85 (25% накладных расходов). Кажется, есть некоторые проблемы с yEnc в основном из-за того, что он использует 8-битный набор символов. Это наводит на мысль: существует ли двоичное кодирование текста на основе набора символов...
Rails: сохранение содержимого двоичного поля в файл
У меня есть модель с двоичным полем, содержащим файл. Я хотел бы сохранить этот файл на диск в рамках необходимого мне процесса. По какой-то причине я ничего не могу найти, как это сделать. Модель содержит поле имени файла и поле file_contents. Я бы хотел сделать что-то вроде этого: model ...
Как сохранить целочисленное значение «0» в файле .bin? (C ++)
РЕДАКТИРОВАТЬ: видимо, проблема в функции чтения: я проверил данные в шестнадцатеричном редакторе 02 00 00 00 01 00 00 00 00 00 00 00 Итак, ноль сохраняется как ноль, а не читается как ноль. Потому что, когда я использую обычную файловую функцию store-in-bin: int a = 0; file.write(re...
Почему эта программа не читает (или пишет?) Правильно из файла .bin? (C ++)
Я создал эту программу: #include <iostream> #include <fstream> using namespace std; int main () { fstream file; file.open("test.bin", ios::in | ios::out | ios::binary); if(!file.is_open()) { return -1; } int n = 5; int x; file.write(reinterpret_cast<char*...
Есть ли в C ++ функция, которая создает файл .bin, или в этом коде чего-то не хватает?
У меня есть код, который выглядит так: int main () { fstream file; file.open("test.bin", ios::out | ios::binary); if(!file.is_open()) { return -1; } int n = 3; file.write(reinterpret_cast<char*>(&n), sizeof(n)); file.close(); return 0; } когда я запускаю ...
C # /. NET - Пользовательские форматы двоичных файлов - с чего начать?
Мне нужно иметь возможность хранить некоторые данные в настраиваемом двоичном формате файла. Я никогда раньше не создавал свой собственный формат файла. Это должен быть удобный формат для путешествий между мирами C #, Java и Ruby / Perl / Python. Для начала файл будет состоять из записей. Пол...
как разбирать двоичные файлы в Clojure
Каков самый чистый способ синтаксического анализа двоичных данных в Clojure? Мне нужно одинаково чисто читать / писать в файл или сокет. что-то вроде: (источник данных для чтения) => {: индекс 42,: размер блока 4, размер данных: 31415,: данные (1 2 3 4 ...)} и обратное для возврата...