Add project
Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
41
Hcs.Client/GostCryptography/Asn1/Ber/Asn1BerInputStream.cs
Normal file
41
Hcs.Client/GostCryptography/Asn1/Ber/Asn1BerInputStream.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System.IO;
|
||||
|
||||
namespace GostCryptography.Asn1.Ber
|
||||
{
|
||||
public class Asn1BerInputStream : Asn1BerDecodeBuffer, IAsn1InputStream
|
||||
{
|
||||
public Asn1BerInputStream(Stream inputStream)
|
||||
: base(inputStream)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual int Available()
|
||||
{
|
||||
var inputStream = GetInputStream();
|
||||
|
||||
if (inputStream != null)
|
||||
{
|
||||
var num = inputStream.Length - inputStream.Position;
|
||||
return (int)num;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
{
|
||||
var inputStream = GetInputStream();
|
||||
|
||||
if (inputStream != null)
|
||||
{
|
||||
inputStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool MarkSupported()
|
||||
{
|
||||
var inputStream = GetInputStream();
|
||||
return ((inputStream != null) && inputStream.CanSeek);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user