Package org.duracloud.chunk.stream
Class KnownLengthInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- org.duracloud.chunk.stream.KnownLengthInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class KnownLengthInputStream extends ByteArrayInputStream
This wraps ByteArrayInputStream and adds a length field.- Author:
- Andrew Woods Date: Feb 10, 2010
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
-
-
Constructor Summary
Constructors Constructor Description KnownLengthInputStream(byte[] bytes)KnownLengthInputStream(String content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLength()-
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readNBytes
-
-
-
-
Constructor Detail
-
KnownLengthInputStream
public KnownLengthInputStream(String content) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
KnownLengthInputStream
public KnownLengthInputStream(byte[] bytes)
-
-