sources/network/bytestream.cpp

branch
protocol5
changeset 84
3bd32eec3d57
parent 83
08bfc3d9d2ae
child 88
08ccaf26cffd
equal deleted inserted replaced
80:f992b027374b 84:3bd32eec3d57
127 METHOD 127 METHOD
128 Bytestream::ensure_read_space (unsigned int bytes) -> void 128 Bytestream::ensure_read_space (unsigned int bytes) -> void
129 { 129 {
130 if (bytes_left() < bytes) 130 if (bytes_left() < bytes)
131 { 131 {
132 throw IOError (format ("attempted to read %1 byte(s) past the end of bytestream", 132 int bytesPast = bytes - bytes_left();
133 bytes - bytes_left())); 133
134 String message;
135 message.sprintf ("attempted to read %d byte%s past the end of bytestream",
136 bytesPast, bytesPast != -1 ? "s" : "");
137 throw IOError (message);
134 } 138 }
135 } 139 }
136 140
137 // ------------------------------------------------------------------------------------------------- 141 // -------------------------------------------------------------------------------------------------
138 // 142 //

mercurial