Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/System.IO/pkg/System.IO.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<ProjectReference Include="..\ref\System.IO.csproj">
<ProjectReference Include="..\ref\System.IO.builds">
<SupportedFramework>net463;netcoreapp1.1;uap10.1;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.IO.csproj">
Expand Down
11 changes: 11 additions & 0 deletions src/System.IO/ref/System.IO.builds
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.IO.csproj" />
<Project Include="System.IO.csproj">
<TargetGroup>netcoreapp1.1</TargetGroup>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>
4 changes: 4 additions & 0 deletions src/System.IO/ref/System.IO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public override void SetLength(long value) { }
public override void Write(byte[] array, int offset, int count) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { return default(System.Threading.Tasks.Task); }
public override void WriteByte(byte value) { }
#if netcoreapp11
public Stream UnderlyingStream { get { return default(Stream); } }
public int BufferSize { get { return 0; } }
#endif
}
public partial class EndOfStreamException : System.IO.IOException
{
Expand Down
7 changes: 2 additions & 5 deletions src/System.IO/ref/System.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker>
<PackageTargetFramework>netstandard1.7;uap10.1</PackageTargetFramework>
<PackageTargetFramework Condition="'$(TargetGroup)'==''">netstandard1.7;uap10.1</PackageTargetFramework>
<DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp1.1'">$(DefineConstants);netcoreapp11</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.IO.cs" />
<Compile Include="System.IO.Manual.cs" />
<!-- ToDo: Remove this P2P reference once new packages are produced and updated -->
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<!-- ToDo: Remove this P2P reference once new packages are produced and updated -->
<ProjectReference Include="..\..\System.Text.Encoding\ref\System.Text.Encoding.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
Expand Down
7 changes: 2 additions & 5 deletions src/System.IO/ref/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"System.Text.Encoding": "4.4.0-beta-24611-02"
},
"frameworks": {
"netstandard1.7": {
"imports": [
"dotnet5.8"
]
}
"netstandard1.7": {},
"netcoreapp1.1": {},
}
}
16 changes: 16 additions & 0 deletions src/System.IO/src/System/IO/BufferedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ private void EnsureBufferAllocated()
_buffer = new byte[_bufferSize];
}

public Stream UnderlyingStream
{
get
{
return _stream;
}
}

public int BufferSize
{
get
{
return _bufferSize;
}
}

public override bool CanRead
{
[Pure]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.IO;
using Xunit;

namespace System.IO.Tests
{
public partial class BufferedStreamTests
{
[Fact]
public void UnderlyingStream()
{
var underlyingStream = new MemoryStream();
var bufferedStream = new BufferedStream(underlyingStream);
Assert.Same(underlyingStream, bufferedStream.UnderlyingStream);
}

[Fact]
public void BufferSize()
{
var bufferedStream = new BufferedStream(new MemoryStream(), 1234);
Assert.Equal(1234, bufferedStream.BufferSize);
}
}
}
4 changes: 4 additions & 0 deletions src/System.IO/tests/System.IO.Tests.builds
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<TargetGroup>netstandard1.5</TargetGroup>
<TestTFMs>netcoreapp1.0</TestTFMs>
</Project>
<Project Include="System.IO.Tests.csproj">
<TargetGroup>netcoreapp1.1</TargetGroup>
<TestTFMs>netcoreapp1.1</TestTFMs>
</Project>
<Project Include="System.IO.Tests.csproj">
<OSGroup>Windows_NT</OSGroup>
<TestTFMs>net463</TestTFMs>
Expand Down
1 change: 1 addition & 0 deletions src/System.IO/tests/System.IO.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Compile Include="BinaryWriter\BinaryWriterTests.cs" />
<Compile Include="BufferedStream\BufferedStream.InvalidParameters.cs" />
<Compile Include="BufferedStream\BufferedStreamTests.cs" />
<Compile Include="BufferedStream\BufferedStreamTests.netcoreapp1.1.cs" Condition="'$(TargetGroup)' == 'netcoreapp1.1'" />
<Compile Include="InvalidDataException\InvalidDataExceptionTests.cs" />
<Compile Include="MemoryStream\MemoryStream.ConstructorTests.cs" />
<Compile Include="MemoryStream\MemoryStream.GetBufferTests.cs" Condition="'$(TargetGroup)'==''" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
<Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="System\InternalHelpers.cs" />
<Compile Include="System\IO\BufferedStreamWrapper.cs" />
<Compile Include="System\IO\NetFxToWinRtStreamAdapter.cs" />
<Compile Include="System\IO\StreamOperationAsyncResult.cs" />
<Compile Include="System\IO\StreamOperationsImplementation.cs" />
Expand Down

This file was deleted.

Loading