/*
(non-Javadoc)
@see javax.jms.StreamMessage#readShort()
359722
@Override
	public short readShort() throws JMSException
    {
    	backupState();
		try
		{
			return MessageConvertTools.asShort(internalReadObject());
		}
    	catch (JMSException e)
    	{
    		restoreState();
    		throw e;	
    	}
    	catch (RuntimeException e)
    	{
    		restoreState();
    		throw e;
    	}
    }
1085799
private void logShort(CharSequence message, boolean trim) throws IOException {
    int length = message.length();
    if (trim) {
      while (length > 0 && Character.isWhitespace(message.charAt(length - 1))) {
        length--;
      }
    }

    char [] chars = new char [length + 1];
    for (int i = 0; i < length; i++) {
      chars[i] = message.charAt(i);
    }
    chars[length] = '\n';

    output.write(chars);
  }
521616
@Override
  public synchronized int read(byte[] buf, int off, int len)
      throws IOException {
    checkNotClosed();

    validatePositionedReadArgs(nextReadPos, buf, off, len);
    if (len == 0) {
      return 0;
    }

    if (contentLength == 0 || (nextReadPos >= contentLength)) {
      return -1;
    }

    try {
      lazySeek(nextReadPos, len);
    } catch (EOFException e) {
      // the end of the file has moved
      return -1;
    }

    int bytesRead;
    try {
      bytesRead = wrappedStream.read(buf, off, len);
    } catch (EOFException e) {
      onReadFailure(e, len);
      // the base implementation swallows EOFs.
      return -1;
    } catch (IOException e) {
      onReadFailure(e, len);
      bytesRead = wrappedStream.read(buf, off, len);
    }

    if (bytesRead > 0) {
      pos += bytesRead;
      nextReadPos += bytesRead;
    }
    incrementBytesRead(bytesRead);
    return bytesRead;
  }
990177
public <T extends MessageLite> T readMessage(
      final Parser<T> parser,
      final ExtensionRegistryLite extensionRegistry)
      throws IOException {
    int length = readRawVarint32();
    if (recursionDepth >= recursionLimit) {
      throw InvalidProtocolBufferException.recursionLimitExceeded();
    }
    final int oldLimit = pushLimit(length);
    ++recursionDepth;
    T result = parser.parsePartialFrom(this, extensionRegistry);
    checkLastTagWas(0);
    --recursionDepth;
    popLimit(oldLimit);
    return result;
  }
1167387
public int readShort()
    throws IOException
  {
    int c1 = _is.read();
    int c2 = _is.read();

    return ((c1 << 8) | c2);
  }
28218
public void read(ByteBuffer buffer) {
        Persistables.persistable(streamableNoBuffers()).read(buffer);

        final int n = getNumDataBuffers();
        int lengthsPosition = buffer.position();
        buffer.position(buffer.position() + 2 * n); // skip positions
        for (int i = 0; i < n; i++) {
            final int size = buffer.getShort(lengthsPosition) & 0xFFFF; // big-endian
            lengthsPosition += 2;

            final ByteBuffer b1 = Persistables.slice(buffer, size);
            setDataBuffer(i, b1);
        }
    }
841048
def read_short(self, base, offset=0):
        
        fmt = b'<H' if self._byte_order is LITTLE_ENDIAN else b'>H'
        return self._read_int(fmt, base, offset)
992451
public static short readShortBigEndian(InputStream io) throws IOException {
		int value = io.read();
		if (value < 0) throw new EOFException();
		int i = io.read();
		if (i < 0) throw new EOFException();
		return (short)(i | (value << 8));
	}
1189836
private static int readShortLength(DataInput in) throws IOException {
        int length = (in.readByte() & 0xFF) << 8;
        return length | (in.readByte() & 0xFF);
    }
808870
public static final short readShort(byte[] array, int offset)
    {
        if (array.length < offset + 2)
        {
            throw new IllegalArgumentException("no room in array");
        }
        return 
                (short) (((array[offset]<<8) & 0xff00) +
                (array[offset + 1] & 0xff ));
    }
784386
public void setShort(Short value) {
		this.checkNull(value);
		list.add(value);
		type.add(Short.class);
	}
757381
private void writeShort(int s, byte[] buf, int offset) throws IOException {
        buf[offset] = (byte)(s & 0xff);
        buf[offset + 1] = (byte)((s >> 8) & 0xff);
    }
255421
public short readShort(short defaultValue, String attribute)
    {
        return Short.parseShort(getValue(String.valueOf(defaultValue), attribute));
    }
281299
private int readShort(InputStream in, CRC32 crc) throws IOException {
        int b = readByte(in, crc);
        return ((readByte(in, crc) << 8) & 0x00ff00) | b;
    }
1129092
public int readShortLE() throws IOException {
        int l = read();
        int h = read();
        if (-1 == h || -1 == l)
            return -1;
        return DataUtils.toShort(h, l);
    }
933294
public static short getShort(ByteBuffer buf, int index) {
        return buf.order() == BIG_ENDIAN ? getShortB(buf, index) : getShortL(buf, index);
    }
272131
@Override
    public short getShort(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            Long longValue = getPrivateInteger(columnIndex);
            if (longValue > Short.MAX_VALUE || longValue < Short.MIN_VALUE) {
                throw new SQLException("Value out of short range");
            }
            return longValue.shortValue();
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }