示例#1
0
        public string ReadLine(
            )
        {
            text::StringBuilder buffer = new text::StringBuilder();

            try
            {
                while (true)
                {
                    int c = stream.ReadByte();
                    if (c == -1)
                    {
                        if (buffer.Length == 0)
                        {
                            return(null);
                        }
                        else
                        {
                            break;
                        }
                    }
                    else if (c == '\r' ||
                             c == '\n')
                    {
                        break;
                    }

                    buffer.Append((char)c);
                }
            }
            catch (IndexOutOfRangeException)
            {}
            return(buffer.ToString());
        }
示例#2
0
        public override string ToString(
            )
        {
            text::StringBuilder buffer = new text::StringBuilder();

            {
                // Begin.
                buffer.Append("[ ");
                // Elements.
                foreach (PdfDirectObject item in items)
                {
                    buffer.Append(PdfDirectObject.ToString(item)).Append(" ");
                }
                // End.
                buffer.Append("]");
            }
            return(buffer.ToString());
        }
示例#3
0
        public string ReadString(
            int length
            )
        {
            text::StringBuilder buffer = new text::StringBuilder();
            int c;

            while ((length--) > 0)
            {
                c = stream.ReadByte();
                if (c == -1)
                {
                    break;
                }

                buffer.Append((char)c);
            }

            return(buffer.ToString());
        }
        public override string ToString(
            )
        {
            text::StringBuilder buffer = new text::StringBuilder();

            {
                // Begin.
                buffer.Append("<< ");
                // Entries.
                foreach (KeyValuePair <PdfName, PdfDirectObject> entry in entries)
                {
                    // Entry...
                    // ...key.
                    buffer.Append(entry.Key.ToString()).Append(" ");
                    // ...value.
                    buffer.Append(PdfDirectObject.ToString(entry.Value)).Append(" ");
                }
                // End.
                buffer.Append(">>");
            }
            return(buffer.ToString());
        }
示例#5
0
        public string ReadLine(
            )
        {
            text::StringBuilder buffer = new text::StringBuilder();

            try
            {
                while (true)
                {
                    int c = data[position++];
                    if (c == '\r' ||
                        c == '\n')
                    {
                        break;
                    }

                    buffer.Append((char)c);
                }
            }
            catch (IndexOutOfRangeException)
            { throw new EndOfStreamException(); }
            return(buffer.ToString());
        }
示例#6
0
        public string ReadLine(
            )
        {
            if (position >= data.Length)
            {
                throw new EndOfStreamException();
            }

            text::StringBuilder buffer = new text::StringBuilder();

            while (position < data.Length)
            {
                int c = data[position++];
                if (c == '\r' ||
                    c == '\n')
                {
                    break;
                }

                buffer.Append((char)c);
            }
            return(buffer.ToString());
        }
示例#7
0
        public string ReadString(
      int length
      )
        {
            text::StringBuilder buffer = new text::StringBuilder();
              int c;

              while((length--) > 0)
              {
            c = stream.ReadByte();
            if(c == -1)
              break;

            buffer.Append((char)c);
              }

              return buffer.ToString();
        }
示例#8
0
        public string ReadLine(
      )
        {
            text::StringBuilder buffer = new text::StringBuilder();
              while(true)
              {
            int c = stream.ReadByte();
            if(c == -1)
              if(buffer.Length == 0)
            return null;
              else
            break;
            else if(c == '\r'
              || c == '\n')
              break;

            buffer.Append((char)c);
              }
              return buffer.ToString();
        }