Package org.apache.poi.hsmf.datatypes
Class ByteChunk
java.lang.Object
org.apache.poi.hsmf.datatypes.Chunk
org.apache.poi.hsmf.datatypes.ByteChunk
A Chunk that holds binary data, normally unparsed. Generally as we know how
to make sense of the contents, we create a new Chunk class and add a special
case in the parser for them.
-
Field Summary
Fields inherited from class org.apache.poi.hsmf.datatypes.Chunk
DEFAULT_NAME_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionByteChunk
(int chunkId, Types.MAPIType type) Create a Byte Chunk, with the specified type.ByteChunk
(String namePrefix, int chunkId, Types.MAPIType type) Creates a Byte Chunk. -
Method Summary
Modifier and TypeMethodDescriptionReturns the data, formatted as a string assuming it was a non-unicode string.byte[]
getValue()
void
readValue
(InputStream value) Reads the value of this chunk using an InputStreamvoid
setValue
(byte[] value) protected static String
toDebugFriendlyString
(byte[] value) Formats the byte array in a debug-friendly way, showing all of a short array, and the start of a longer one.toString()
Returns the data in a debug-friendly string formatvoid
writeValue
(OutputStream out) Writes the value of this chunk back out again.Methods inherited from class org.apache.poi.hsmf.datatypes.Chunk
getChunkId, getEntryName, getType
-
Constructor Details
-
ByteChunk
Creates a Byte Chunk. -
ByteChunk
Create a Byte Chunk, with the specified type.
-
-
Method Details
-
readValue
Description copied from class:Chunk
Reads the value of this chunk using an InputStream- Specified by:
readValue
in classChunk
- Throws:
IOException
-
writeValue
Description copied from class:Chunk
Writes the value of this chunk back out again.- Specified by:
writeValue
in classChunk
- Throws:
IOException
-
getValue
public byte[] getValue() -
setValue
public void setValue(byte[] value) -
toString
Returns the data in a debug-friendly string format -
toDebugFriendlyString
Formats the byte array in a debug-friendly way, showing all of a short array, and the start of a longer one. -
getAs7bitString
Returns the data, formatted as a string assuming it was a non-unicode string. If your data isn't in fact stored as basically ASCII, don't expect this to return much of any sense....- Returns:
- the data formatted as a string
-