/** * Creates a {@link PropertySet} instance from a byte array that * represents a stream in the Horrible Property Set Format. * * @param stream The byte array holding the stream data. * @param offset The offset in {@code stream} where the stream * data begin. If the stream data begin with the first byte in the * array, the {@code offset} is 0. * @param length The length of the stream data. * @throws NoPropertySetStreamException if the byte array is not a * property set stream. * * @exception UnsupportedEncodingException if the codepage is not supported. */ public PropertySet(final byte[] stream, final int offset, final int length) throws NoPropertySetStreamException, UnsupportedEncodingException { if (!isPropertySetStream(stream, offset, length)) { throw new NoPropertySetStreamException(); } init(stream, offset, length); }
throw new POIRuntimeException(new DocumentReadException(e.getMessage(), e));
/** * Creates a {@link PropertySet} instance from an {@link * InputStream} in the Horrible Property Set Format.<p> * * The constructor reads the first few bytes from the stream * and determines whether it is really a property set stream. If * it is, it parses the rest of the stream. If it is not, it * resets the stream to its beginning in order to let other * components mess around with the data and throws an * exception. * * @param stream Holds the data making out the property set * stream. * @throws IOException * if the {@link InputStream} cannot be accessed as needed. * @exception NoPropertySetStreamException * if the input stream does not contain a property set. * @exception UnsupportedEncodingException * if a character encoding is not supported. */ public PropertySet(final InputStream stream) throws NoPropertySetStreamException, IOException { if (!isPropertySetStream(stream)) { throw new NoPropertySetStreamException(); } final byte[] buffer = IOUtils.toByteArray(stream); init(buffer, 0, buffer.length); }
format != PropertySet.FORMAT_ASSERTION || sectionCount < 0) { throw new NoPropertySetStreamException();
/** * Creates a {@link PropertySet} instance from a byte array that * represents a stream in the Horrible Property Set Format. * * @param stream The byte array holding the stream data. * @param offset The offset in {@code stream} where the stream * data begin. If the stream data begin with the first byte in the * array, the {@code offset} is 0. * @param length The length of the stream data. * @throws NoPropertySetStreamException if the byte array is not a * property set stream. * * @exception UnsupportedEncodingException if the codepage is not supported. */ public PropertySet(final byte[] stream, final int offset, final int length) throws NoPropertySetStreamException, UnsupportedEncodingException { if (!isPropertySetStream(stream, offset, length)) { throw new NoPropertySetStreamException(); } init(stream, offset, length); }
/** * <p>Creates a {@link PropertySet} instance from a byte array * that represents a stream in the Horrible Property Set * Format.</p> * * @param stream The byte array holding the stream data. * @param offset The offset in <var>stream</var> where the stream * data begin. If the stream data begin with the first byte in the * array, the <var>offset</var> is 0. * @param length The length of the stream data. * @throws NoPropertySetStreamException if the byte array is not a * property set stream. * * @exception UnsupportedEncodingException if the codepage is not supported. */ public PropertySet(final byte[] stream, final int offset, final int length) throws NoPropertySetStreamException, UnsupportedEncodingException { if (isPropertySetStream(stream, offset, length)) init(stream, offset, length); else throw new NoPropertySetStreamException(); }
/** * <p>Creates a {@link PropertySet} instance from a byte array * that represents a stream in the Horrible Property Set * Format.</p> * * @param stream The byte array holding the stream data. * @param offset The offset in <var>stream</var> where the stream * data begin. If the stream data begin with the first byte in the * array, the <var>offset</var> is 0. * @param length The length of the stream data. * @throws NoPropertySetStreamException if the byte array is not a * property set stream. * * @exception UnsupportedEncodingException if the codepage is not supported. */ public PropertySet(final byte[] stream, final int offset, final int length) throws NoPropertySetStreamException, UnsupportedEncodingException { if (isPropertySetStream(stream, offset, length)) init(stream, offset, length); else throw new NoPropertySetStreamException(); }
/** * Creates a {@link PropertySet} instance from an {@link * InputStream} in the Horrible Property Set Format.<p> * * The constructor reads the first few bytes from the stream * and determines whether it is really a property set stream. If * it is, it parses the rest of the stream. If it is not, it * resets the stream to its beginning in order to let other * components mess around with the data and throws an * exception. * * @param stream Holds the data making out the property set * stream. * @throws IOException * if the {@link InputStream} cannot be accessed as needed. * @exception NoPropertySetStreamException * if the input stream does not contain a property set. * @exception UnsupportedEncodingException * if a character encoding is not supported. */ public PropertySet(final InputStream stream) throws NoPropertySetStreamException, IOException { if (!isPropertySetStream(stream)) { throw new NoPropertySetStreamException(); } final byte[] buffer = IOUtils.toByteArray(stream); init(buffer, 0, buffer.length); }
format != PropertySet.FORMAT_ASSERTION || sectionCount < 0) { throw new NoPropertySetStreamException();