org.restlet.engine.http.header

## Class RangeWriter

- java.lang.Object
- - java.io.Writer
  - - java.io.StringWriter
    - - org.restlet.engine.http.header.HeaderWriter<Range>
      - - org.restlet.engine.http.header.RangeWriter

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class RangeWriter
    extends HeaderWriter<Range>

Range header writer.

Author:
  Jerome Louvel

### Field Summary

### Fields inherited from class java.io.Writer

`lock`

### Constructor Summary

Constructors
Constructor and Description
`RangeWriter()`

### Method Summary

Methods
`RangeWriter` `append(java.util.List<Range> ranges)` Format `ranges` as a Range header value
`HeaderWriter<Range>` `append(Range range)` Appends a value.
`static java.lang.String` `write(java.util.List<Range> ranges)` Format `ranges` as a Range header value
`static java.lang.String` `write(Range range, long size)` Format `range` as a Content-Range header value

### Methods inherited from class org.restlet.engine.http.header.HeaderWriter

`append, append, append, append, append, append, appendComment, appendExtension, appendExtension, appendParameterSeparator, appendProduct, appendQuotedPair, appendQuotedString, appendSpace, appendToken, appendUriEncoded, appendValueSeparator, canWrite`

### Methods inherited from class java.io.StringWriter

`append, close, flush, getBuffer, toString, write, write, write, write`

### Methods inherited from class java.io.Writer

`write`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### RangeWriter

    public RangeWriter()

### Method Detail

#### write

    public static java.lang.String write(java.util.List<Range> ranges)

Format `ranges` as a Range header value

Parameters:
  `ranges` - List of ranges to format
Returns:
  `ranges` formatted or null if the list is null or empty.

#### write

    public static java.lang.String write(Range range,
                         long size)

Format `range` as a Content-Range header value

Parameters:
  `range` - Range to format
  `size` - Total size of the entity
Returns:
  `range` formatted

#### append

    public RangeWriter append(java.util.List<Range> ranges)

Format `ranges` as a Range header value

Parameters:
  `ranges` - List of ranges to format
Returns:
  This writer.

#### append

    public HeaderWriter<Range> append(Range range)

Description copied from class: `HeaderWriter`
Appends a value.

Specified by:
  `append` in class `HeaderWriter<Range>`
Parameters:
  `range` - The value.
Returns:
  This writer.