private void ParseChunkSize() { byte[] fieldBytes = new byte[4]; for (int i = 0; i < 4; i++) { int readByte = FileInputStream.ReadByte(); if (readByte == -1) { throw new ImproperFormatException("WAVE file did not contain a full header"); } fieldBytes[i] = ByteHelper.ReverseEndian((byte)readByte); } ChunkSize_ = ByteHelper.ReverseEndian(ByteHelper.BytesToInt(fieldBytes)); }