public final class DataHelper extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
extractBytes(InputStream inputStream)
Extract by bytes from the given stream.
|
static byte[] |
extractBytes(InputStream inputStream,
long start,
int length)
Extract a portion of the bytes from the given stream.
|
static String |
extractString(Clob value)
Extract the contents of the given Clob as a string.
|
static String |
extractString(Reader reader)
Extract the contents of the given reader/stream as a string.
|
static String |
extractString(Reader reader,
int lengthHint)
Extract the contents of the given reader/stream as a string.
|
static boolean |
isNClob(Class type) |
static InputStream |
subStream(InputStream inputStream,
long start,
int length)
Extract a portion of the bytes from the given stream., wrapping them in a new stream.
|
static Object |
subStream(Reader characterStream,
long start,
int length)
Extract a portion of a reader, wrapping the portion in a new reader.
|
public static boolean isNClob(Class type)
public static String extractString(Reader reader)
reader
- The reader for the contentpublic static String extractString(Reader reader, int lengthHint)
reader
- The reader for the contentlengthHint
- if the length is known in advance the implementation can be slightly more efficientpublic static Object subStream(Reader characterStream, long start, int length)
characterStream
- The reader for the contentstart
- The start position/offset (0-based, per general stream/reader contracts).length
- The amount to extractpublic static byte[] extractBytes(InputStream inputStream)
inputStream
- The stream of bytes.byte[]
public static byte[] extractBytes(InputStream inputStream, long start, int length)
inputStream
- The stream of bytes.start
- The start position/offset (0-based, per general stream/reader contracts).length
- The amount to extractpublic static InputStream subStream(InputStream inputStream, long start, int length)
inputStream
- The stream of bytes.start
- The start position/offset (0-based, per general stream/reader contracts).length
- The amount to extractCopyright © 2001-2017 Red Hat, Inc. All Rights Reserved.