From 76f6084db4c8d20b83060306d7432d3a4fdac0ae 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 5b238b004..fa67dfdda 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 *