summaryrefslogtreecommitdiff
path: root/NW4RTools/InputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'NW4RTools/InputStream.cs')
-rw-r--r--NW4RTools/InputStream.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/NW4RTools/InputStream.cs b/NW4RTools/InputStream.cs
index 3a776b4..134cb93 100644
--- a/NW4RTools/InputStream.cs
+++ b/NW4RTools/InputStream.cs
@@ -29,8 +29,14 @@ namespace NW4RTools {
MustReverseArrays = !BitConverter.IsLittleEndian;
}
+ public bool AtEnd {
+ get {
+ return (Position == Data.Length);
+ }
+ }
+
public void Seek(int pos) {
- if (pos < 0 || pos >= Data.Length)
+ if (pos < 0 || pos > Data.Length)
throw new ArgumentOutOfRangeException();
Position = pos;
@@ -60,6 +66,10 @@ namespace NW4RTools {
return ret;
}
+ public SByte ReadSByte() {
+ return unchecked((sbyte)ReadByte());
+ }
+
public Int16 ReadInt16() {
return BitConverter.ToInt16(ReadReversedBytes(2), 0);
}