From 24b3701fb64b7a16a2ad5c8310c0406eb74bb5bb Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Fri, 21 Oct 2011 21:25:03 +0000 Subject: [PATCH] reuse code from LittleEndian class git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1187550 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/util/LittleEndian.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/java/org/apache/poi/util/LittleEndian.java b/src/java/org/apache/poi/util/LittleEndian.java index 5b238b0049..fa67dfdda1 100644 --- a/src/java/org/apache/poi/util/LittleEndian.java +++ b/src/java/org/apache/poi/util/LittleEndian.java @@ -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 *