Changeset 170:bef543dec5c3

Show
Ignore:
Timestamp:
02/22/08 18:56:35 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix for LEDataStream unread

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/internal/image/LEDataInputStream.d

    r48 r170  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2006 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    9494     */ 
    9595    override public int read(byte b[], int off, int len) { 
    96         int read = 0, count; 
    97         while (read !is len && (count = readData(b, off, len - read)) !is -1) { 
     96        int read_ = 0, count; 
     97        while (read_ !is len && (count = readData(b, off, len - read_)) !is -1) { 
    9898            off += count; 
    99             read += count; 
     99            read_ += count; 
    100100        } 
    101         position += read
    102         if (read is 0 && read !is len) return -1; 
    103         return read
     101        position += read_
     102        if (read_ is 0 && read_ !is len) return -1; 
     103        return read_
    104104    } 
    105105 
     
    144144 
    145145        int inCopied = host.read( buffer, newOffset, len - cacheCopied ); 
    146         if( inCopied is -1 ) inCopied = -1; 
    147146        if (inCopied > 0 ) return inCopied + cacheCopied; 
    148147        if (cacheCopied is 0) return inCopied; 
     
    156155    public int readInt() { 
    157156        byte[4] buf = void; 
    158         host.read(buf); 
     157        read(buf); 
    159158        return ((((((buf[3] & 0xFF) << 24) | 
    160159            (buf[2] & 0xFF)) << 16) | 
     
    169168    public short readShort() { 
    170169        byte[2] buf = void; 
    171         host.read(buf); 
     170        read(buf); 
    172171        return cast(short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF)); 
    173172    }