/** * get a short value from an InputStream * * @param stream * the InputStream from which the short is to be read * @return the short (16-bit) value * @exception IOException * will be propagated back to the caller * @exception BufferUnderrunException * if the stream cannot provide enough bytes */ public static short readShort( InputStream stream ) throws IOException, BufferUnderrunException { return (short) readUShort( stream ); }
/** * get a short value from an InputStream * * @param stream * the InputStream from which the short is to be read * @return the short (16-bit) value * @exception IOException * will be propagated back to the caller * @exception BufferUnderrunException * if the stream cannot provide enough bytes */ public static short readShort( InputStream stream ) throws IOException, BufferUnderrunException { return (short) readUShort( stream ); }
/** * get a short value from an InputStream * * @param stream * the InputStream from which the short is to be read * @return the short (16-bit) value * @exception IOException * will be propagated back to the caller * @exception BufferUnderrunException * if the stream cannot provide enough bytes */ public static short readShort( InputStream stream ) throws IOException, BufferUnderrunException { return (short) readUShort( stream ); }
/** * get a short value from an InputStream * * @param stream * the InputStream from which the short is to be read * @return the short (16-bit) value * @exception IOException * will be propagated back to the caller * @exception BufferUnderrunException * if the stream cannot provide enough bytes */ public static short readShort( InputStream stream ) throws IOException, BufferUnderrunException { return (short) readUShort( stream ); }
public HMEFDumper(InputStream inp) throws IOException { this.inp = inp; // Check the signature matches int sig = LittleEndian.readInt(inp); if(sig != HMEFMessage.HEADER_SIGNATURE) { throw new IllegalArgumentException( "TNEF signature not detected in file, " + "expected " + HMEFMessage.HEADER_SIGNATURE + " but got " + sig ); } // Skip over the File ID LittleEndian.readUShort(inp); }
public HMEFDumper(InputStream inp) throws IOException { this.inp = inp; // Check the signature matches long sig = LittleEndian.readInt(inp); if(sig != HMEFMessage.HEADER_SIGNATURE) { throw new IllegalArgumentException( "TNEF signature not detected in file, " + "expected " + HMEFMessage.HEADER_SIGNATURE + " but got " + sig ); } // Skip over the File ID LittleEndian.readUShort(inp); }
public HMEFMessage(InputStream inp) throws IOException { // Check the signature matches long sig = LittleEndian.readInt(inp); if(sig != HEADER_SIGNATURE) { throw new IllegalArgumentException( "TNEF signature not detected in file, " + "expected " + HEADER_SIGNATURE + " but got " + sig ); } // Read the File ID fileId = LittleEndian.readUShort(inp); // Now begin processing the contents process(inp, 0); }
public HMEFMessage(InputStream inp) throws IOException { try { // Check the signature matches int sig = LittleEndian.readInt(inp); if (sig != HEADER_SIGNATURE) { throw new IllegalArgumentException( "TNEF signature not detected in file, " + "expected " + HEADER_SIGNATURE + " but got " + sig ); } // Read the File ID fileId = LittleEndian.readUShort(inp); // Now begin processing the contents process(inp); } finally { inp.close(); } }
/** * Creates a new TNEF Attribute by reading data from * the stream within a {@link HMEFMessage} */ public static TNEFAttribute create(InputStream inp) throws IOException { int id = LittleEndian.readUShort(inp); int type = LittleEndian.readUShort(inp); // Create as appropriate if(id == TNEFProperty.ID_MAPIPROPERTIES.id || id == TNEFProperty.ID_ATTACHMENT.id) { return new TNEFMAPIAttribute(id, type, inp); } if(type == TNEFProperty.TYPE_STRING || type == TNEFProperty.TYPE_TEXT) { return new TNEFStringAttribute(id, type, inp); } if(type == TNEFProperty.TYPE_DATE) { return new TNEFDateAttribute(id, type, inp); } return new TNEFAttribute(id, type, inp); }
/** * Creates a new TNEF Attribute by reading data from * the stream within a {@link HMEFMessage} */ public static TNEFAttribute create(InputStream inp) throws IOException { int id = LittleEndian.readUShort(inp); int type = LittleEndian.readUShort(inp); // Create as appropriate if(id == TNEFProperty.ID_MAPIPROPERTIES.id || id == TNEFProperty.ID_ATTACHMENT.id) { return new TNEFMAPIAttribute(id, type, inp); } if(type == TNEFProperty.TYPE_STRING || type == TNEFProperty.TYPE_TEXT) { return new TNEFStringAttribute(id, type, inp); } if(type == TNEFProperty.TYPE_DATE) { return new TNEFDateAttribute(id, type, inp); } return new TNEFAttribute(id, type, inp); }
/** * Constructs a single new attribute from the id, type, * and the contents of the stream */ protected TNEFAttribute(int id, int type, InputStream inp) throws IOException { this.type = type; int length = LittleEndian.readInt(inp); property = TNEFProperty.getBest(id, type); data = new byte[length]; IOUtils.readFully(inp, data); checksum = LittleEndian.readUShort(inp); }
/** * Constructs a single new attribute from the id, type, * and the contents of the stream */ protected TNEFAttribute(int id, int type, InputStream inp) throws IOException { this.type = type; int length = LittleEndian.readInt(inp); property = TNEFProperty.getBest(id, type); data = IOUtils.safelyAllocate(length, MAX_RECORD_LENGTH); IOUtils.readFully(inp, data); checksum = LittleEndian.readUShort(inp); }
int typeAndMV = LittleEndian.readUShort(inp); int id = LittleEndian.readUShort(inp);
int typeAndMV = LittleEndian.readUShort(inp); int id = LittleEndian.readUShort(inp);
try { int typeID = LittleEndian.readUShort(value); int id = LittleEndian.readUShort(value); long flags = LittleEndian.readUInt(value);