From d032037615fb28980f2d92dbe500fc2fcfdd37ee Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sun, 18 Oct 2015 11:33:33 +0700 Subject: http://www.bouncycastle.org/jira/browse/BMA-90 - Make CmsReadable public - Make a few methods virtual --- crypto/src/cms/CMSProcessableFile.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'crypto/src/cms/CMSProcessableFile.cs') diff --git a/crypto/src/cms/CMSProcessableFile.cs b/crypto/src/cms/CMSProcessableFile.cs index cbc74f44b..01020df11 100644 --- a/crypto/src/cms/CMSProcessableFile.cs +++ b/crypto/src/cms/CMSProcessableFile.cs @@ -13,38 +13,33 @@ namespace Org.BouncyCastle.Cms { private const int DefaultBufSize = 32 * 1024; - private readonly FileInfo _file; + private readonly FileInfo _file; private readonly int _bufSize; - public CmsProcessableFile( - FileInfo file) + public CmsProcessableFile(FileInfo file) : this(file, DefaultBufSize) { } - public CmsProcessableFile( - FileInfo file, - int bufSize) + public CmsProcessableFile(FileInfo file, int bufSize) { _file = file; _bufSize = bufSize; } - public virtual Stream GetInputStream() + public virtual Stream GetInputStream() { - return new FileStream( - _file.FullName, FileMode.Open, FileAccess.Read, FileShare.Read, _bufSize); + return new FileStream(_file.FullName, FileMode.Open, FileAccess.Read, FileShare.Read, _bufSize); } - public virtual void Write( - Stream zOut) + public virtual void Write(Stream zOut) { Stream inStr = GetInputStream(); Streams.PipeAll(inStr, zOut); inStr.Close(); } - /// The file handle + /// The file handle [Obsolete] public virtual object GetContent() { -- cgit 1.5.1 From 604feba429aa6604f45613b130f6b3eae89dfda1 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sun, 18 Oct 2015 21:09:12 +0700 Subject: PCL: No support for FileInfo/FileStream --- crypto/src/cms/CMSProcessableFile.cs | 2 ++ crypto/src/openpgp/PgpLiteralDataGenerator.cs | 2 ++ crypto/src/openpgp/PgpUtilities.cs | 2 ++ 3 files changed, 6 insertions(+) (limited to 'crypto/src/cms/CMSProcessableFile.cs') diff --git a/crypto/src/cms/CMSProcessableFile.cs b/crypto/src/cms/CMSProcessableFile.cs index 01020df11..764d138f0 100644 --- a/crypto/src/cms/CMSProcessableFile.cs +++ b/crypto/src/cms/CMSProcessableFile.cs @@ -1,3 +1,4 @@ +#if !PORTABLE using System; using System.IO; @@ -47,3 +48,4 @@ namespace Org.BouncyCastle.Cms } } } +#endif diff --git a/crypto/src/openpgp/PgpLiteralDataGenerator.cs b/crypto/src/openpgp/PgpLiteralDataGenerator.cs index 3b1f2fe74..17a6eeef2 100644 --- a/crypto/src/openpgp/PgpLiteralDataGenerator.cs +++ b/crypto/src/openpgp/PgpLiteralDataGenerator.cs @@ -141,6 +141,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return new WrappedGeneratorStream(this, pkOut); } +#if !PORTABLE /// ///

/// Open a literal data packet for the passed in FileInfo object, returning @@ -162,6 +163,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp { return Open(outStr, format, file.Name, file.Length, file.LastWriteTime); } +#endif ///

/// Close the literal data packet - this is equivalent to calling Close() diff --git a/crypto/src/openpgp/PgpUtilities.cs b/crypto/src/openpgp/PgpUtilities.cs index 4f3cb6e73..f982ae459 100644 --- a/crypto/src/openpgp/PgpUtilities.cs +++ b/crypto/src/openpgp/PgpUtilities.cs @@ -347,6 +347,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return MakeKey(algorithm, keyBytes); } +#if !PORTABLE /// Write out the passed in file as a literal data packet. public static void WriteFileToLiteralData( Stream output, @@ -384,6 +385,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp pOut.Close(); inputStream.Close(); } +#endif private const int ReadAhead = 60; -- cgit 1.5.1