View | Details | Raw Unified | Return to bug 14735
Collapse All | Expand All

(-)scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java (-14 / +15 lines)
Lines 196-214 Link Here
196
      if(unicode)
196
      if(unicode)
197
      {
197
      {
198
        add = 2;
198
        add = 2;
199
      }
199
        char ch;
200
      char ch;
200
        for(int y = start; y < end; y += add)
201
      for(int y = start; y < end; y += add)
202
      {
203
        if(unicode)
204
        {
205
          ch = (char)Utils.convertBytesToShort(_header, y);
206
        }
207
        else
208
        {
201
        {
209
          ch = (char)_header[y];
202
	  ch = (char)Utils.convertBytesToShort(_header, y);
203
	  out.write(ch);
210
        }
204
        }
211
        out.write(ch);
205
      }
206
      else
207
      {
208
	String sText = new String(_header, start, end-start);
209
	out.write(sText);
212
      }
210
      }
213
    }
211
    }
214
  }
212
  }
Lines 221-230 Link Here
221
   */
219
   */
222
  public WordDocument(String fileName) throws IOException
220
  public WordDocument(String fileName) throws IOException
223
  {
221
  {
224
222
  	this(new FileInputStream(fileName));
225
223
  }
224
  
225
  public WordDocument(InputStream inputStream) throws IOException
226
  {
226
        //do Ole stuff
227
        //do Ole stuff
227
        istream = new FileInputStream(fileName);
228
        istream = inputStream;
228
        filesystem = new POIFSFileSystem(istream);
229
        filesystem = new POIFSFileSystem(istream);
229
230
230
        //get important stuff from the Header block and parse all the
231
        //get important stuff from the Header block and parse all the

Return to bug 14735