MiscUtil.IO.EndianBinaryReader.Read C# (CSharp) 메소드

Read() 공개 메소드

Reads a single character from the stream, using the character encoding for this reader. If no characters have been fully read by the time the stream ends, -1 is returned.
public Read ( ) : int
리턴 int
        public int Read()
        {
            int charsRead = Read(charBuffer, 0, 1);
            if (charsRead==0)
            {
                return -1;
            }
            else
            {
                return charBuffer[0];
            }
        }

Same methods

EndianBinaryReader::Read ( byte buffer, int index, int count ) : int
EndianBinaryReader::Read ( char data, int index, int count ) : int

Usage Example

        public void ReadCharsBeyondInternalBufferSize()
        {
            MemoryStream stream = new MemoryStream(TestBytes);
            EndianBinaryReader subject = new EndianBinaryReader(EndianBitConverter.Little, stream);

            char[] chars = new char[TestString.Length];
            subject.Read(chars, 0, chars.Length);
            Assert.AreEqual(TestString, new string(chars));
        }
All Usage Examples Of MiscUtil.IO.EndianBinaryReader::Read