Skip to content

Commit

Permalink
Renamed ByteOutputStream methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkolb committed May 18, 2018
1 parent f6568f1 commit d667c08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## ChangeLog

### 9.1.0
* Renamed ByteOutputStream write methods to mirror ByteInputStream read methods.

### 9.0.0
* Updated Examples
* File API stayed the same, but buffer API has changed drastically (again)
Expand Down
12 changes: 6 additions & 6 deletions Sources/Lilliput/ByteOutputStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public protocol ByteOutputStream {
}

extension ByteOutputStream {
@_transparent public func write(_ value: Int8) throws { try writeUInt8 (UInt8 (bitPattern: value)) }
@_transparent public func write(_ value: Int16) throws { try writeUInt16(UInt16(bitPattern: value)) }
@_transparent public func write(_ value: Int32) throws { try writeUInt32(UInt32(bitPattern: value)) }
@_transparent public func write(_ value: Int64) throws { try writeUInt64(UInt64(bitPattern: value)) }
public func writeInt8 (_ value: Int8) throws { try writeUInt8 (UInt8 (bitPattern: value)) }
public func writeInt16(_ value: Int16) throws { try writeUInt16(UInt16(bitPattern: value)) }
public func writeInt32(_ value: Int32) throws { try writeUInt32(UInt32(bitPattern: value)) }
public func writeInt64(_ value: Int64) throws { try writeUInt64(UInt64(bitPattern: value)) }

@_transparent public func write(_ value: Float32) throws { try writeUInt32(value.bitPattern) }
@_transparent public func write(_ value: Float64) throws { try writeUInt64(value.bitPattern) }
public func writeFloat32(_ value: Float32) throws { try writeUInt32(value.bitPattern) }
public func writeFloat64(_ value: Float64) throws { try writeUInt64(value.bitPattern) }
}

0 comments on commit d667c08

Please sign in to comment.