1
0
mirror of https://github.com/Rogiel/httpchannel synced 2025-12-06 07:32:50 +00:00

Adds SeekableDownloadChannel documentation page

This commit is contained in:
2012-01-18 20:39:40 -02:00
parent 179570680d
commit cd2b479b5b
4 changed files with 76 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Home</title>
<author email="rogiel@rogiel.com">Rogiel Sulzbach</author>
</properties>
<body>
<!-- The body of the document contains a number of sections -->
<section name="SeekableDownloadChannel">
<p>
The
<b>SeekableDownloadChannel</b>
allows you to emulate the download stream as if it was a local file:
you can go back and forth. All of that comes at a cost, you need to
restart the download everytime you set the channel position.
</p>
<source><![CDATA[final DownloadChannel downloadChannel = ...; // open a download channel here
final SeekableDownloadChannel channel = new SeekableDownloadChannel(downloadChannel);
channel.position(12 * 1024);]]></source>
<small>
Creates a new
<b>SeekableDownloadChannel</b>
channel and set its position to the 12288 byte offset.
</small>
<p>
If the channel does not support seeking, an
<b>IOException</b>
is thrown at construction time.
</p>
</section>
</body>
</document>

View File

@@ -172,6 +172,7 @@
<artifactId>site-maven-plugin</artifactId> <artifactId>site-maven-plugin</artifactId>
<version>0.4</version> <version>0.4</version>
<configuration> <configuration>
<message>Creating ${project.artifactId} site for ${project.version}</message>
<repositoryOwner>seedbox</repositoryOwner> <repositoryOwner>seedbox</repositoryOwner>
<repositoryOwner>httpchannel.github.com</repositoryOwner> <repositoryOwner>httpchannel.github.com</repositoryOwner>
</configuration> </configuration>
@@ -207,7 +208,7 @@
<version>2.2.2</version> <version>2.2.2</version>
<configuration> <configuration>
<autoVersionSubmodules>true</autoVersionSubmodules> <autoVersionSubmodules>true</autoVersionSubmodules>
<goals>deploy site-deploy</goals><!-- we have to force site-deploy --> <goals>deploy</goals><!-- we have to force site-deploy -->
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@@ -6,6 +6,8 @@
<menu ref="parent" inherit="top" /> <menu ref="parent" inherit="top" />
<menu name="API" inherit="top"> <menu name="API" inherit="top">
<item name="Channel seeking" href="/httpchannel-api/seekable-download-channel.html"
target="_blank" />
<item name="API Javadoc" href="/httpchannel-api/apidocs/" <item name="API Javadoc" href="/httpchannel-api/apidocs/"
target="_blank" /> target="_blank" />
<item name="API Sources" href="/httpchannel-api/xref/" /> <item name="API Sources" href="/httpchannel-api/xref/" />

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Home</title>
<author email="rogiel@rogiel.com">Rogiel Sulzbach</author>
</properties>
<body>
<!-- The body of the document contains a number of sections -->
<section name="SeekableDownloadChannel">
<p>
The
<b>SeekableDownloadChannel</b>
allows you to emulate the download stream as if it was a local file:
you can go back and forth. All of that comes at a cost, you need to
restart the download everytime you set the channel position.
</p>
<source><![CDATA[final DownloadChannel downloadChannel = ...; // open a download channel here
final SeekableDownloadChannel channel = new SeekableDownloadChannel(downloadChannel);
channel.position(12 * 1024);]]></source>
<small>
Creates a new
<b>SeekableDownloadChannel</b>
channel and set its position to the 12288 byte offset.
</small>
<p>
If the channel does not support seeking, an
<b>IOException</b>
is thrown at construction time.
</p>
</section>
</body>
</document>