java.lang.Iterable<java.nio.ByteBuffer>, ContentProvider, ContentProvider.Typedpublic class PathContentProvider extends AbstractTypedContentProvider
A ContentProvider for files using JDK 7's java.nio.file APIs.
It is possible to specify, at the constructor, a buffer size used to read
content from the stream, by default 4096 bytes.
If a ByteBufferPool is provided via setByteBufferPool(ByteBufferPool),
the buffer will be allocated from that pool, otherwise one buffer will be
allocated and used to read the file.
ContentProvider.Typed| Constructor | Description |
|---|---|
PathContentProvider(java.lang.String contentType,
java.nio.file.Path filePath) |
|
PathContentProvider(java.lang.String contentType,
java.nio.file.Path filePath,
int bufferSize) |
|
PathContentProvider(java.nio.file.Path filePath) |
|
PathContentProvider(java.nio.file.Path filePath,
int bufferSize) |
| Modifier and Type | Method | Description |
|---|---|---|
ByteBufferPool |
getByteBufferPool() |
|
long |
getLength() |
|
java.util.Iterator<java.nio.ByteBuffer> |
iterator() |
|
void |
setByteBufferPool(ByteBufferPool byteBufferPool) |
getContentTypepublic PathContentProvider(java.nio.file.Path filePath)
throws java.io.IOException
java.io.IOExceptionpublic PathContentProvider(java.nio.file.Path filePath,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionpublic PathContentProvider(java.lang.String contentType,
java.nio.file.Path filePath)
throws java.io.IOException
java.io.IOExceptionpublic PathContentProvider(java.lang.String contentType,
java.nio.file.Path filePath,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionpublic long getLength()
public ByteBufferPool getByteBufferPool()
public void setByteBufferPool(ByteBufferPool byteBufferPool)
public java.util.Iterator<java.nio.ByteBuffer> iterator()
Copyright © 1995–2017 Webtide. All rights reserved.