This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if let stream:InputStream = InputStream(fileAtPath: "/Users/pebble8888/hoge.txt") { | |
| var buf:[UInt8] = [UInt8](repeating: 0, count: 16) | |
| stream.open() | |
| while true { | |
| let len = stream.read(&buf, maxLength: buf.count) | |
| print("len \(len)") | |
| for i in 0..<len { | |
| print(String(format:"%02x ", buf[i]), terminator: "") | |
| } | |
| if len < buf.count { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIBezierPath { | |
| class func getAxisAlignedArrowPoints(inout points: Array<CGPoint>, forLength: CGFloat, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat ) { | |
| let tailLength = forLength - headLength | |
| points.append(CGPointMake(0, tailWidth/2)) | |
| points.append(CGPointMake(tailLength, tailWidth/2)) | |
| points.append(CGPointMake(tailLength, headWidth/2)) | |
| points.append(CGPointMake(forLength, 0)) | |
| points.append(CGPointMake(tailLength, -headWidth/2)) |