当前位置: 首页>>代码示例>>C#>>正文


C# Sharpen.InputStream类代码示例

本文整理汇总了C#中Sharpen.InputStream的典型用法代码示例。如果您正苦于以下问题:C# InputStream类的具体用法?C# InputStream怎么用?C# InputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InputStream类属于Sharpen命名空间,在下文中一共展示了InputStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PackIndexV1

		/// <exception cref="NGit.Errors.CorruptObjectException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		internal PackIndexV1(InputStream fd, byte[] hdr)
		{
			byte[] fanoutTable = new byte[IDX_HDR_LEN];
			System.Array.Copy(hdr, 0, fanoutTable, 0, hdr.Length);
			IOUtil.ReadFully(fd, fanoutTable, hdr.Length, IDX_HDR_LEN - hdr.Length);
			idxHeader = new long[256];
			// really unsigned 32-bit...
			for (int k = 0; k < idxHeader.Length; k++)
			{
				idxHeader[k] = NB.DecodeUInt32(fanoutTable, k * 4);
			}
			idxdata = new byte[idxHeader.Length][];
			for (int k_1 = 0; k_1 < idxHeader.Length; k_1++)
			{
				int n;
				if (k_1 == 0)
				{
					n = (int)(idxHeader[k_1]);
				}
				else
				{
					n = (int)(idxHeader[k_1] - idxHeader[k_1 - 1]);
				}
				if (n > 0)
				{
					idxdata[k_1] = new byte[n * (Constants.OBJECT_ID_LENGTH + 4)];
					IOUtil.ReadFully(fd, idxdata[k_1], 0, idxdata[k_1].Length);
				}
			}
			objectCnt = idxHeader[255];
			packChecksum = new byte[20];
			IOUtil.ReadFully(fd, packChecksum, 0, packChecksum.Length);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:35,代码来源:PackIndexV1.cs

示例2: Attachment

		internal Attachment(InputStream contentStream, string contentType)
		{
			this.body = contentStream;
			metadata = new Dictionary<string, object>();
			metadata.Put("content_type", contentType);
			metadata.Put("follows", true);
			this.gzipped = false;
		}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:8,代码来源:Attachment.cs

示例3: StreamReader

		public StreamReader(InputStream stream)
		{
			if (stream == null)
			{
				throw new ArgumentNullException();
			}
			_stream = stream;
		}
开发者ID:renaud91,项目名称:n-metadata-extractor,代码行数:8,代码来源:StreamReader.cs

示例4: MergedStream

 public MergedStream(com.fasterxml.jackson.core.io.IOContext ctxt, Sharpen.InputStream
     @in, byte[] buf, int start, int end)
 {
     _ctxt = ctxt;
     _in = @in;
     _b = buf;
     _ptr = start;
     _end = end;
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:9,代码来源:MergedStream.cs

示例5: ReadMetadata

		public static Com.Drew.Metadata.Metadata ReadMetadata(InputStream inputStream)
		{
			// TIFF processing requires random access, as directories can be scattered throughout the byte sequence.
			// InputStream does not support seeking backwards, and so is not a viable option for TIFF processing.
			// We use RandomAccessStreamReader, which buffers data from the stream as we seek forward.
			Com.Drew.Metadata.Metadata metadata = new Com.Drew.Metadata.Metadata();
			new ExifReader().ExtractTiff(new RandomAccessStreamReader(inputStream), metadata);
			return metadata;
		}
开发者ID:renaud91,项目名称:n-metadata-extractor,代码行数:9,代码来源:TiffMetadataReader.cs

示例6: ZInputStream

		public ZInputStream(InputStream @in, int level) : base(@in)
		{
			[email protected] = @in;
			z.DeflateInit(level);
			compress = true;
			z.next_in = buf;
			z.next_in_index = 0;
			z.avail_in = 0;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:9,代码来源:ZInputStream.cs

示例7: close

 /*
 /**********************************************************
 /* Public API
 /**********************************************************
 */
 /// <exception cref="System.IO.IOException"/>
 public override void close()
 {
     Sharpen.InputStream @in = _in;
     if (@in != null)
     {
         _in = null;
         freeBuffers();
         @in.close();
     }
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:16,代码来源:UTF32Reader.cs

示例8: InputStreamBody

 public InputStreamBody(InputStream @in, string mimeType, string filename) : base(
     mimeType)
 {
     if (@in == null)
     {
         throw new ArgumentException("Input stream may not be null");
     }
     [email protected] = @in;
     this.filename = filename;
 }
开发者ID:jonlipsky,项目名称:couchbase-lite-net,代码行数:10,代码来源:InputStreamBody.cs

示例9: DataFormatMatcher

 protected internal DataFormatMatcher(Sharpen.InputStream @in, byte[] buffered, int
     bufferedStart, int bufferedLength, com.fasterxml.jackson.core.JsonFactory match
     , com.fasterxml.jackson.core.format.MatchStrength strength)
 {
     _originalStream = @in;
     _bufferedData = buffered;
     _bufferedStart = bufferedStart;
     _bufferedLength = bufferedLength;
     _match = match;
     _matchStrength = strength;
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:11,代码来源:DataFormatMatcher.cs

示例10: CopyStream

 /// <exception cref="System.IO.IOException"></exception>
 public static void CopyStream(InputStream @is, OutputStream os)
 {
     int n;
     byte[] buffer = new byte[16384];
     while ((n = @is.Read(buffer)) > -1)
     {
         os.Write(buffer, 0, n);
     }
     os.Close();
     @is.Close();
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-couchbase-lite-net-couchbase,代码行数:12,代码来源:StreamUtils.cs

示例11: CopyStreamToFile

 /// <exception cref="System.IO.IOException"></exception>
 public static void CopyStreamToFile(InputStream @is, FilePath file)
 {
     OutputStream os = new FileOutputStream(file);
     int n;
     byte[] buffer = new byte[16384];
     while ((n = @is.Read(buffer)) > -1)
     {
         os.Write(buffer, 0, n);
     }
     os.Close();
     @is.Close();
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-couchbase-lite-net-couchbase,代码行数:13,代码来源:StreamUtils.cs

示例12: URLConnection

		public URLConnection(Uri url) : base(url)
		{
			responseInputStream = new PipedInputStream();
			try
			{
				responseOutputStream = new PipedOutputStream((PipedInputStream)responseInputStream
					);
			}
			catch (IOException e)
			{
				Log.E(Database.Tag, "Exception creating piped output stream", e);
			}
		}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:13,代码来源:URLConnection.cs

示例13: Std

 /// <summary>
 /// Constructor used when content to check is available via
 /// input stream and must be read.
 /// </summary>
 public Std(Sharpen.InputStream @in, byte[] buffer)
 {
     /*
     /**********************************************************
     /* Standard implementation
     /**********************************************************
     */
     _in = @in;
     _buffer = buffer;
     _bufferedStart = 0;
     _ptr = 0;
     _bufferedEnd = 0;
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:17,代码来源:InputAccessor.cs

示例14: Read

		/// <exception cref="System.IO.IOException"></exception>
		public static byte[] Read(InputStream @is)
		{
			int initialCapacity = 1024;
			ByteArrayBuffer byteArrayBuffer = new ByteArrayBuffer(initialCapacity);
			byte[] bytes = new byte[512];
			int offset = 0;
			int numRead = 0;
			while ((numRead = @is.Read(bytes, offset, bytes.Length - offset)) >= 0)
			{
				byteArrayBuffer.Append(bytes, 0, numRead);
				offset += numRead;
			}
			return byteArrayBuffer.ToByteArray();
		}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:15,代码来源:TextUtils.cs

示例15: UTF32Reader

 public UTF32Reader(com.fasterxml.jackson.core.io.IOContext ctxt, Sharpen.InputStream
     @in, byte[] buf, int ptr, int len, bool isBigEndian)
 {
     /*
     /**********************************************************
     /* Life-cycle
     /**********************************************************
     */
     _context = ctxt;
     _in = @in;
     _buffer = buf;
     _ptr = ptr;
     _length = len;
     _bigEndian = isBigEndian;
     _managedBuffers = (@in != null);
 }
开发者ID:davidraleigh,项目名称:jackson-parser-cs,代码行数:16,代码来源:UTF32Reader.cs


注:本文中的Sharpen.InputStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。