Package org.apache.poi.hsmf.datatypes
Class StringChunk
- java.lang.Object
-
- org.apache.poi.hsmf.datatypes.Chunk
-
- org.apache.poi.hsmf.datatypes.StringChunk
-
public class StringChunk extends Chunk
A Chunk made up of a single string.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hsmf.datatypes.Chunk
DEFAULT_NAME_PREFIX
-
-
Constructor Summary
Constructors Constructor Description StringChunk(int chunkId, Types.MAPIType type)
Create a String Chunk, with the specified type.StringChunk(java.lang.String namePrefix, int chunkId, Types.MAPIType type)
Creates a String Chunk.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
get7BitEncoding()
Returns the Encoding that will be used to decode any "7 bit" (non unicode) data.byte[]
getRawValue()
java.lang.String
getValue()
Returns the Text value of the chunkprotected static java.lang.String
parseAs7BitData(byte[] data)
Parses as non-unicode, supposedly 7 bit CP1252 data and returns the string that that yields.protected static java.lang.String
parseAs7BitData(byte[] data, java.lang.String encoding)
Parses as non-unicode, supposedly 7 bit data and returns the string that that yields.void
readValue(java.io.InputStream value)
Reads the value of this chunk using an InputStreamvoid
set7BitEncoding(java.lang.String encoding)
Sets the Encoding that will be used to decode any "7 bit" (non unicode) data.void
setValue(java.lang.String str)
java.lang.String
toString()
void
writeValue(java.io.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 Detail
-
StringChunk
public StringChunk(java.lang.String namePrefix, int chunkId, Types.MAPIType type)
Creates a String Chunk.
-
StringChunk
public StringChunk(int chunkId, Types.MAPIType type)
Create a String Chunk, with the specified type.
-
-
Method Detail
-
get7BitEncoding
public java.lang.String get7BitEncoding()
Returns the Encoding that will be used to decode any "7 bit" (non unicode) data. Most files default to CP1252
-
set7BitEncoding
public void set7BitEncoding(java.lang.String encoding)
Sets the Encoding that will be used to decode any "7 bit" (non unicode) data. This doesn't appear to be stored anywhere specific in the file, so you may need to guess by looking at headers etc
-
readValue
public void readValue(java.io.InputStream value) throws java.io.IOException
Description copied from class:Chunk
Reads the value of this chunk using an InputStream
-
writeValue
public void writeValue(java.io.OutputStream out) throws java.io.IOException
Description copied from class:Chunk
Writes the value of this chunk back out again.- Specified by:
writeValue
in classChunk
- Throws:
java.io.IOException
-
getValue
public java.lang.String getValue()
Returns the Text value of the chunk
-
getRawValue
public byte[] getRawValue()
-
setValue
public void setValue(java.lang.String str)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
parseAs7BitData
protected static java.lang.String parseAs7BitData(byte[] data)
Parses as non-unicode, supposedly 7 bit CP1252 data and returns the string that that yields.
-
parseAs7BitData
protected static java.lang.String parseAs7BitData(byte[] data, java.lang.String encoding)
Parses as non-unicode, supposedly 7 bit data and returns the string that that yields.
-
-