public NTriplesParser(PeterO.Support.InputStream stream)
 {
     if ((stream) == null)
     {
         throw new ArgumentNullException("stream");
     }
     this.input = new StackableCharacterInput(
         new AsciiCharacterInput(stream));
     bnodeLabels = new PeterO.Support.LenientDictionary <string, RDFTerm>();
 }
Exemplo n.º 2
0
 public static void copyStream(PeterO.Support.InputStream stream, Stream output)
 {
     byte[] buffer = new byte[8192];
     while (true)
     {
         int count = stream.Read(buffer, 0, buffer.Length);
         if (count < 0)
         {
             break;
         }
         output.Write(buffer, 0, count);
     }
 }
Exemplo n.º 3
0
        public static void inputStreamToFile(PeterO.Support.InputStream stream, PeterO.Support.File file)
        {
            FileStream output = null;

            try {
                output = new FileStream((file).ToString(), FileMode.Create);
                copyStream(stream, output);
            } finally {
                if (output != null)
                {
                    output.Close();
                }
            }
        }
Exemplo n.º 4
0
        public static string streamToString(string charset, PeterO.Support.InputStream stream)
        {
            TextReader    reader  = new StreamReader(stream, System.Text.Encoding.GetEncoding(charset));
            StringBuilder builder = new StringBuilder();

            char[] buffer = new char[4096];
            while (true)
            {
                int count = reader.Read(buffer, 0, (buffer).Length);
                if (count < 0)
                {
                    break;
                }
                builder.Append(buffer, 0, count);
            }
            return(builder.ToString());
        }
Exemplo n.º 5
0
 public static void skipToEnd(PeterO.Support.InputStream stream)
 {
     if (stream == null)
     {
         return;
     }
     while (true)
     {
         byte[] x = new byte[1024];
         try {
             int c = stream.Read(x, 0, x.Length);
             if (c < 0)
             {
                 break;
             }
         } catch (IOException) {
             break; // maybe this stream is already closed
         }
     }
 }
Exemplo n.º 6
0
 public Utf8CharacterInput(PeterO.Support.InputStream stream)
 {
     this.stream = stream;
 }
 public ConditionalBufferInputStream(PeterO.Support.InputStream input)
 {
     this.stream = input;
     this.buffer = new byte[1024];
 }
Exemplo n.º 8
0
 public AsciiCharacterInput(PeterO.Support.InputStream stream)
 {
     this.stream=stream;
 }
 public ConditionalBufferInputStream(PeterO.Support.InputStream input)
 {
     this.stream=input;
     this.buffer=new byte[1024];
 }
Exemplo n.º 10
0
 public static string streamToString(PeterO.Support.InputStream stream)
 {
     return(streamToString("UTF-8", stream));
 }
 public DecoderCharacterInput(PeterO.Support.InputStream input, ITextDecoder decoder, IEncodingError error)
 {
     this.input=input;
     this.decoder=decoder;
     this.error=error;
 }
 public DecoderCharacterInput(PeterO.Support.InputStream input, ITextDecoder decoder)
 {
     this.input=input;
     this.decoder=decoder;
 }