reuse code from LittleEndian class

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1187550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-21 21:25:03 +00:00
parent a35cf979d2
commit 76f6084db4

View File

@ -624,6 +624,23 @@ public class LittleEndian implements LittleEndianConsts
data[i++] = (byte) ( ( value >>> 8 ) & 0xFF );
}
/**
* Put unsigned short into output stream
*
* @param value
* the unsigned short (16-bit) value
* @param outputStream
* output stream
* @throws IOException
* if an I/O error occurs
*/
public static void putUShort( int value, OutputStream outputStream )
throws IOException
{
outputStream.write( (byte) ( ( value >>> 0 ) & 0xFF ) );
outputStream.write( (byte) ( ( value >>> 8 ) & 0xFF ) );
}
/**
* get an int value from an InputStream
*