Skip to content

File format

在进行IO之前,必须首先定义file format,这是IO的前提。

What is file format?

file format是一种schema,它描述了data的structure。在superuser What are the general differences between a format and a protocol 中,有这样的描述:

A format describes the structure of some data

Examples

protobuf

SQLite

About SQLite中,有这样的介绍:

A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. The database file format is cross-platform - you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures. These features make SQLite a popular choice as an Application File Format. SQLite database files are a recommended storage format by the US Library of Congress. Think of SQLite not as a replacement for Oracle but as a replacement for fopen()

SQLite Database File Format

This document describes and defines the on-disk database file format used by all releases of SQLite since version 3.0.0 (2004-06-18).

SQLite As An Application File Format

Json

MessagePack

NOTE: 这是我在阅读cnblogs 软件开发中的几种数据交换协议时,其中提及的一种

Redis

Redis RDB Dump File Format