public class ByteSourceInputStream extends ByteSource
Constructor and Description |
---|
ByteSourceInputStream(InputStream is,
String fileName) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getAll() |
byte[] |
getBlock(long blockStart,
int blockLength) |
String |
getDescription() |
InputStream |
getInputStream() |
long |
getLength()
This operation can be VERY expensive; for inputstream byte sources, the
entire stream must be drained to determine its length.
|
getBlock, getFileName, getInputStream
public ByteSourceInputStream(InputStream is, String fileName)
public InputStream getInputStream() throws IOException
getInputStream
in class ByteSource
IOException
public byte[] getBlock(long blockStart, int blockLength) throws IOException
getBlock
in class ByteSource
IOException
public long getLength() throws IOException
ByteSource
getLength
in class ByteSource
IOException
- if it fails to read the byte source datapublic byte[] getAll() throws IOException
getAll
in class ByteSource
IOException
public String getDescription()
getDescription
in class ByteSource
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.