var bytes: [UInt8] = [0x30, 0x0e, 0x0a, 0x1b, 0x64, 0x03] let length = outputStream.write(&bytes, maxLength: bytes.count) if length < 0 { print("error!") } else if length == 0 { print("full.") } else { if length != bytes.count { print("write data was split.") } // ॻ͖ࠐΜͩσʔλͷআ bytes = Array(bytes.dropFirst(length)) }