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.
  • Constructor Details

    • StringChunk

      public StringChunk(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 Details

    • get7BitEncoding

      public 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(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(InputStream value) throws IOException
      Description copied from class: Chunk
      Reads the value of this chunk using an InputStream
      Specified by:
      readValue in class Chunk
      Throws:
      IOException
    • writeValue

      public void writeValue(OutputStream out) throws IOException
      Description copied from class: Chunk
      Writes the value of this chunk back out again.
      Specified by:
      writeValue in class Chunk
      Throws:
      IOException
    • getValue

      public String getValue()
      Returns the Text value of the chunk
    • getRawValue

      public byte[] getRawValue()
    • setValue

      public void setValue(String str)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseAs7BitData

      protected static String parseAs7BitData(byte[] data)
      Parses as non-unicode, supposedly 7 bit CP1252 data and returns the string that that yields.
    • parseAs7BitData

      protected static String parseAs7BitData(byte[] data, String encoding)
      Parses as non-unicode, supposedly 7 bit data and returns the string that that yields.