hypercore-byte-stream

WebJar for hypercore-byte-stream

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

hypercore-byte-stream
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

hypercore-byte-stream
WebJar for hypercore-byte-stream
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/andrewosh/hypercore-byte-stream

Скачать hypercore-byte-stream

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/hypercore-byte-stream/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>hypercore-byte-stream</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/hypercore-byte-stream/
implementation 'org.webjars.npm:hypercore-byte-stream:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/hypercore-byte-stream/
implementation ("org.webjars.npm:hypercore-byte-stream:1.0.4")
'org.webjars.npm:hypercore-byte-stream:jar:1.0.4'
<dependency org="org.webjars.npm" name="hypercore-byte-stream" rev="1.0.4">
  <artifact name="hypercore-byte-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='hypercore-byte-stream', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "hypercore-byte-stream" % "1.0.4"
[org.webjars.npm/hypercore-byte-stream "1.0.4"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : readable-stream jar [3.1.1,4)

Модули Проекта

Данный проект не имеет модулей.

hypercore-byte-stream

Build Status

A Readable stream wrapper around Hypercore that supports reading byte ranges.

When provided with optional start/end block heuristics, this module will efficiently sync only those blocks which contain the specified range.

Supports asynchronously specifying stream options, as well as the input feed, to remove the need for additional stream management modules like duplexify.

Most of the code has been extracted from Hyperdrive.

Usage

The following example will return a byte stream of the entire input feed.

const ram = require('random-access-memory')
const hypercore = require('hypercore')
const createByteStream = require('hypercore-byte-stream')

let core = hypercore(ram)
let stream = createByteStream({
  feed: core
})

API

stream = createStream([options])

Creates a new byte stream.

If specified, options can include:

{
  feed: core, // A hypercore.
  byteOffset: 0, // Starting offset in bytes from the start of the feed.
  byteLength: 10, // The number of bytes to read.
  blockOffset: 0, // An optional starting block heuristic (optimization).
  blockLength: 10 // An optional block length that should contain the entire range (optimization).
}

stream.start([options])

Starts downloading and streaming according to the specified options.

Options are the same as in createStream. If a feed was specified in the stream constructor, then one should not provide another stream in the start options.

License

MIT

Версии библиотеки

Версия
1.0.4